-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure the right config for all docs (#866)
Ensure that the right cspell config is returned even if the document is not in one of the workspace folders. ## Other improvements * fix: improve the integration tests * dev: Remove code for Node 8 and 10 * ci: increase integration timeouts for testing * fix: Make sure to include the schema for cspell.json in the extension * fix: make sure the correct config file is returned If the document is not part of the workspace folders, make sure the correct config file is returned. * dev: Make sure `package.json` is in the list of possible config files * test: add user words to the sampleWorkspaces * Update cspell-words.txt * debug: debug the integration tests
- Loading branch information
Showing
24 changed files
with
226 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,5 +88,6 @@ visualstudio | |
vsce | ||
vsmarketplacebadge | ||
webhook | ||
webpack'ed | ||
webview | ||
yandex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "0.2", | ||
"dictionaryDefinitions": [ | ||
{ | ||
"path": "./user-words.txt", | ||
"name": "user-words", | ||
"addWords": true, | ||
"scope": "user" | ||
} | ||
], | ||
"dictionaries": [ | ||
"user-words" | ||
], | ||
"words": [] | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
packages/_integrationTests/sampleWorkspaces/workspace1/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Workspace 1 | ||
|
||
Sample README file. |
21 changes: 21 additions & 0 deletions
21
packages/_integrationTests/sampleWorkspaces/workspace2/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Jason Dent | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
7 changes: 7 additions & 0 deletions
7
packages/_integrationTests/sampleWorkspaces/workspace2/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Workspace 2 | ||
|
||
This workspace has a `package.json` with a `cspell` section. | ||
|
||
Custom words: | ||
|
||
- Workspacetwo |
17 changes: 17 additions & 0 deletions
17
packages/_integrationTests/sampleWorkspaces/workspace2/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "workspace2", | ||
"version": "1.0.0", | ||
"description": "Sample Workspace 2", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo test" | ||
}, | ||
"cspell": { | ||
"version": "0.2", | ||
"words": [ | ||
"workspacetwo" | ||
] | ||
}, | ||
"author": "", | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,2 @@ | ||
import type { CSpellUserSettings } from '@cspell/cspell-types'; | ||
import { TextDocument } from 'vscode'; | ||
|
||
export interface ExtensionApi { | ||
registerConfig(path: string): void; | ||
triggerGetSettings(): void; | ||
enableLanguageId(languageId: string, uri?: string): Thenable<void>; | ||
disableLanguageId(languageId: string, uri?: string): Thenable<void>; | ||
enableCurrentLanguage(): Thenable<void>; | ||
disableCurrentLanguage(): Thenable<void>; | ||
addWordToUserDictionary(word: string): Thenable<void>; | ||
addWordToWorkspaceDictionary(word: string, uri?: string | null): Thenable<void>; | ||
// enableLocale(target: ConfigTarget, locale: string): Thenable<void>; | ||
// disableLocale(target: ConfigTarget, locale: string): Thenable<void>; | ||
updateSettings(): boolean; | ||
cSpellClient(): CSpellClient; | ||
} | ||
|
||
export interface CSpellClient { | ||
getConfigurationForDocument(document: TextDocument | undefined): Promise<GetConfigurationForDocumentResult>; | ||
} | ||
export interface GetConfigurationForDocumentResult { | ||
languageEnabled: boolean | undefined; | ||
fileEnabled: boolean | undefined; | ||
settings: CSpellUserSettings | undefined; | ||
docSettings: CSpellUserSettings | undefined; | ||
excludedBy: ExcludeRef[] | undefined; | ||
} | ||
|
||
export interface ExcludeRef { | ||
glob: string; | ||
id: string | undefined; | ||
name: string | undefined; | ||
filename: string | undefined; | ||
} | ||
export type { ExtensionApi } from '../../client/dist/extensionApi'; | ||
export type { CSpellClient } from '../../client/dist/client'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.