mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Add first pass at reducing non-confident guesses
This commit is contained in:
parent
5696f5dfd4
commit
51702c7b5f
|
@ -56,10 +56,13 @@ export class LanguageDetectionSimpleWorker extends EditorSimpleWorker {
|
|||
};
|
||||
|
||||
const historicalResolver = async () => {
|
||||
if (langBiases) {
|
||||
const regexpDetection = await this.runRegexpModel(documentTextSample, langBiases);
|
||||
if (regexpDetection) {
|
||||
return regexpDetection;
|
||||
// only detect when we have at least a line of data
|
||||
if (documentTextSample.length > 20 || documentTextSample.includes('\n')) {
|
||||
if (langBiases) {
|
||||
const regexpDetection = await this.runRegexpModel(documentTextSample, langBiases);
|
||||
if (regexpDetection) {
|
||||
return regexpDetection;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in a new issue