-
Notifications
You must be signed in to change notification settings - Fork 23
Enable semantic rules (enableSemanticRules) seems to lint previous file versions? #222
Comments
Weird. The "May negatively affect performance." means that the process is pretty slow, and may either impact the renderer thread, or cause the lint results to not be near instant. |
Alright, I've figured out what's going on. Basically, when This package passes the editors source into the public lint(fileName: string, source: string, configuration: IConfigurationFile = DEFAULT_CONFIG): void {
const sourceFile = this.getSourceFile(fileName, source);
// ... Trouble is, when run with private getSourceFile(fileName: string, source: string) {
if (this.program !== undefined) {
const sourceFile = this.program.getSourceFile(fileName);
if (sourceFile === undefined) {
const INVALID_SOURCE_ERROR = dedent`
Invalid source file: ${fileName}. Ensure that the files supplied to lint have a .ts, .tsx, .d.ts, .js or .jsx extension.
`;
throw new FatalError(INVALID_SOURCE_ERROR);
}
return sourceFile;
} else {
return utils.getSourceFile(fileName, source);
}
} That means that it can only update the lint information once the file is saved. It appears the only difference for Unfortunately, I'm not sure what can be done to fix this. Any thoughts? |
I don't know if it's related to this, but think might be. |
The enable semantic rules option (
enableSemanticRules
) appears to cause the linter to lint the previous versions of the file saved on disk, rather than the current contents of the editor. This is especially noticeable in atom-ide-ui which does not update the linting again on save, but is also noticeable in linter-ui-default as the linting does not update while typing.GIF of the issue in atom-ide-ui:
Is this maybe what is meant by "May negatively affect performance"?EDIT: I've figured out what's going on here, and detailed it below.
The text was updated successfully, but these errors were encountered: