Skip to content

Commit

Permalink
fix: Only evaluate CodeActions that are for cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Feb 19, 2020
1 parent 2a12c03 commit 88a6095
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/_server/src/codeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export function onCodeActionHandler(
const actions: CodeAction[] = [];
const { context, textDocument: { uri } } = params;
const { diagnostics } = context;
if (!diagnostics.length) return [];
const spellCheckerDiags = diagnostics.filter(diag => diag.source === Validator.diagSource);
if (!spellCheckerDiags.length) return [];
const optionalTextDocument = documents.get(uri);
if (!optionalTextDocument) return [];
log(`CodeAction Only: ${context.only} Num: ${diagnostics.length}`, uri);
Expand Down Expand Up @@ -96,7 +97,6 @@ export function onCodeActionHandler(

async function genCodeActionsForSuggestions(_dictionary: SpellingDictionary) {
log('CodeAction generate suggestions');
const spellCheckerDiags = diagnostics.filter(diag => diag.source === Validator.diagSource);
let diagWord: string | undefined;
for (const diag of spellCheckerDiags) {
const word = extractText(textDocument, diag.range);
Expand Down

0 comments on commit 88a6095

Please sign in to comment.