Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
Merge branch 'master' into vscode-upkeep
Elijah Potter8206f42b202a
diff --cc packages/vscode-plugin/src/tests/suite/integration.test.tsindex 9c718a4d6,4ededca13..1b56af3d4--- a/packages/vscode-plugin/src/tests/suite/integration.test.ts+++ b/packages/vscode-plugin/src/tests/suite/integration.test.ts@@@ -10,10 -11,8 +11,11 @@@ importgetActualDiagnostics,openFile,openUntitled,+ setTextDocumentLanguage,- sleep,+ waitForHarperToActivate,+ waitForUpdatesFromConfigChange,+ waitForUpdatesFromDeletedFile,+ waitForUpdatesFromOpenedFile,} from './helper';describe('Integration >', () => {@@@ -21,9 -20,12 +23,10 @@@let markdownUri: Uri;beforeAll(async () => {+ await closeAll();harper = await activateHarper();- // Open test file so diagnostics can occurmarkdownUri = await openFile('integration.md');- // Wait for `harper-ls` to start- await sleep(500);+ await waitForHarperToActivate();});it('runs', () => {@@@ -63,6 -63,41 +66,41 @@@);});+ it('gives correct diagnostics when language is changed', async () => {+ const untitledUri = await openUntitled('Errorz # Errorz');+ await setTextDocumentLanguage(untitledUri, 'plaintext');++ // Wait for `harper-ls` to send diagnostics- await sleep(500);++ await waitForUpdatesFromConfigChange();++ compareActualVsExpectedDiagnostics(+ getActualDiagnostics(untitledUri),+ createExpectedDiagnostics(+ {+ message: 'Did you mean to spell “Errorz” this way?',+ range: createRange(0, 0, 0, 6),+ },+ {+ message: 'Did you mean to spell “Errorz” this way?',+ range: createRange(0, 9, 0, 15),+ },+ ),+ );++ await setTextDocumentLanguage(untitledUri, 'shellscript');++ // Wait for `harper-ls` to send diagnostics- await sleep(500);++ await waitForUpdatesFromConfigChange();++ compareActualVsExpectedDiagnostics(+ getActualDiagnostics(untitledUri),+ createExpectedDiagnostics({+ message: 'Did you mean to spell “Errorz” this way?',+ range: createRange(0, 9, 0, 15),+ }),+ );+ });+it('updates diagnostics on configuration change', async () => {const config = workspace.getConfiguration('harper.linters');await config.update('RepeatedWords', false, ConfigurationTarget.Workspace);