We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1943737 commit 5db76fdCopy full SHA for 5db76fd
src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts
@@ -56,10 +56,13 @@ export class LanguageDetectionSimpleWorker extends EditorSimpleWorker {
56
};
57
58
const historicalResolver = async () => {
59
+ // only detect when we have at least a line of data
60
if (langBiases) {
- const regexpDetection = await this.runRegexpModel(documentTextSample, langBiases);
61
- if (regexpDetection) {
62
- return regexpDetection;
+ if (documentTextSample.length > 20 || documentTextSample.includes('\n')) {
+ const regexpDetection = await this.runRegexpModel(documentTextSample, langBiases);
63
+ if (regexpDetection) {
64
+ return regexpDetection;
65
+ }
66
}
67
68
return undefined;
0 commit comments