提交 66cb21b0 编写于 作者: S Sandeep Somavarapu

Fix #107999

上级 5987e407
......@@ -150,8 +150,15 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
}
private onModelAdded(model: ITextModel): void {
const uri = model.uri;
const supportedSchemes = [Schemas.untitled, Schemas.file, Schemas.vscodeRemote];
if (!uri || !supportedSchemes.includes(uri.scheme)) {
return;
}
this.promptRecommendationsForModel(model);
this._register(model.onDidChangeLanguage(() => this.promptRecommendationsForModel(model)));
const disposable = model.onDidChangeLanguage(() => this.promptRecommendationsForModel(model));
model.onWillDispose(() => disposable.dispose());
}
/**
......@@ -160,11 +167,6 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
*/
private promptRecommendationsForModel(model: ITextModel): void {
const uri = model.uri;
const supportedSchemes = [Schemas.untitled, Schemas.file, Schemas.vscodeRemote];
if (!uri || !supportedSchemes.includes(uri.scheme)) {
return;
}
const language = model.getLanguageIdentifier().language;
const fileExtension = extname(uri).toLowerCase();
if (this.processedLanguages.includes(language) && this.processedFileExtensions.includes(fileExtension)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册