Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not late bind parsers #3175

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/cspell-bundled-dicts/cspell-default.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use strict";
const index_js_1 = require("cspell-grammar/parsers/typescript/index.js");
const settings = {
version: '0.2',
name: 'cspell default settings .js',
Expand Down Expand Up @@ -134,10 +133,5 @@ const settings = {
'@cspell/dict-typescript/cspell-ext.json',
'@cspell/dict-vue/cspell-ext.json',
],
plugins: [
{
parsers: [index_js_1.parser],
},
],
};
module.exports = settings;
8 changes: 0 additions & 8 deletions packages/cspell-bundled-dicts/cspell-default.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* eslint-disable node/no-missing-import */
/* eslint-disable import/no-unresolved */
import type { AdvancedCSpellSettings } from '@cspell/cspell-types';
import { parser as parserTypeScript } from 'cspell-grammar/parsers/typescript/index.js';

const settings: AdvancedCSpellSettings = {
version: '0.2',
Expand Down Expand Up @@ -138,11 +135,6 @@ const settings: AdvancedCSpellSettings = {
'@cspell/dict-typescript/cspell-ext.json',
'@cspell/dict-vue/cspell-ext.json',
],
plugins: [
{
parsers: [parserTypeScript],
},
],
};

export = settings;
35 changes: 7 additions & 28 deletions packages/cspell-bundled-dicts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/cspell-bundled-dicts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
"@cspell/dict-software-terms": "^2.1.9",
"@cspell/dict-swift": "^1.0.3",
"@cspell/dict-typescript": "^2.0.0",
"@cspell/dict-vue": "^2.0.2",
"cspell-grammar": "^6.2.1"
"@cspell/dict-vue": "^2.0.2"
},
"engines": {
"node": ">=14"
Expand Down
1 change: 1 addition & 0 deletions packages/cspell-grammar/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { compileGrammar, tokenizeLine, tokenizeText } from './parser';
export type { Grammar, GrammarDef, Pattern, Repository } from './parser';
export { parsers } from './parsers';
2 changes: 2 additions & 0 deletions packages/cspell-grammar/src/parsers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { parser as parserTypeScript } from './typescript';
export const parsers = [parserTypeScript];
1 change: 1 addition & 0 deletions packages/cspell-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cspell-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"configstore": "^5.0.1",
"cosmiconfig": "^7.0.1",
"cspell-glob": "^6.2.0",
"cspell-grammar": "^6.2.1",
"cspell-io": "^6.2.0",
"cspell-trie-lib": "^6.2.1",
"fast-equals": "^4.0.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/cspell-lib/src/Settings/DefaultSettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PredefinedPatterns, RegExpPatternDefinition } from '@cspell/cspell-types';
import { parsers } from 'cspell-grammar';
import { createCSpellSettingsInternal, CSpellSettingsInternal } from '../Models/CSpellSettingsInternalDef';
import { PatternRegExp } from '../Models/PatternRegExp';
import { resolveFile } from '../util/resolveFile';
Expand Down Expand Up @@ -103,6 +104,7 @@ export const _defaultSettingsBasis: Readonly<CSpellSettingsInternal> = Object.fr
languageSettings: [],
source: { name: 'defaultSettings' },
reporters: [],
plugins: [{ parsers }],
})
);

Expand Down