File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import * as mypy from './../linters/mypy';
1212import * as settings from '../common/configSettings' ;
1313import * as telemetryHelper from '../common/telemetry' ;
1414import * as telemetryContracts from '../common/telemetryContracts' ;
15+ import * as fs from 'fs' ;
16+
1517import { LinterErrors } from '../common/constants'
1618const lintSeverityToVSSeverity = new Map < linter . LintMessageSeverity , vscode . DiagnosticSeverity > ( ) ;
1719lintSeverityToVSSeverity . set ( linter . LintMessageSeverity . Error , vscode . DiagnosticSeverity . Error )
@@ -85,6 +87,9 @@ export class LintProvider extends vscode.Disposable {
8587 if ( e . languageId !== 'python' || ! this . settings . linting . enabled ) {
8688 return ;
8789 }
90+ if ( ! e . uri . path || ( path . basename ( e . uri . path ) === e . uri . path && ! fs . existsSync ( e . uri . path ) ) ) {
91+ return ;
92+ }
8893 this . lintDocument ( e , e . uri , e . getText ( ) . split ( / \r ? \n / g) , 100 ) ;
8994 } , this . context . subscriptions ) ;
9095
You can’t perform that action at this time.
0 commit comments