Skip to content

Commit

Permalink
fix: replace brackets in folders and files (#443)
Browse files Browse the repository at this point in the history
Co-authored-by: Divlo <[email protected]>
  • Loading branch information
josegutierro and theoludwig authored Jul 27, 2022
1 parent 31d2fb8 commit 3a6d198
Show file tree
Hide file tree
Showing 16 changed files with 1,333 additions and 1,424 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.1

- **Fix**: Detect brackets in filename and **folders** ([#443](https://github.com/standard/vscode-standard/pull/443))

## 2.1.0

- **Feature**: Add support for `standard-engine@15` ([#376](https://github.com/standard/vscode-standard/pull/376))
Expand Down
126 changes: 63 additions & 63 deletions client/package-lock.json

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

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
},
"devDependencies": {
"@types/glob": "^7.2.0",
"vscode-languageclient": "^7.0.0",
"vscode-nls": "^5.0.0"
"vscode-languageclient": "^8.0.2",
"vscode-nls": "^5.0.1"
},
"dependencies": {
"@types/vscode": "^1.66.0",
"@types/vscode": "^1.69.0",
"ts-standard": "file:../node_modules/ts-standard",
"vscode-uri": "^3.0.3"
}
Expand Down
44 changes: 23 additions & 21 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import {
} from 'vscode'
import {
CloseAction,
CloseHandlerResult,
DidCloseTextDocumentNotification,
DidOpenTextDocumentNotification,
DocumentFilter,
ErrorAction,
ErrorHandler,
ErrorHandlerResult,
ExecuteCommandParams,
ExecuteCommandRequest,
LanguageClient,
Expand Down Expand Up @@ -384,11 +385,11 @@ export function realActivate (context: ExtensionContext): void {
TextDocument
>()

Workspace.onDidChangeConfiguration(() => {
Workspace.onDidChangeConfiguration(async () => {
for (const textDocument of syncedDocuments.values()) {
if (!shouldBeValidated(textDocument)) {
syncedDocuments.delete(textDocument.uri.toString())
client.sendNotification(
await client.sendNotification(
DidCloseTextDocumentNotification.type,
client.code2ProtocolConverter.asCloseTextDocumentParams(textDocument)
)
Expand All @@ -399,7 +400,7 @@ export function realActivate (context: ExtensionContext): void {
!syncedDocuments.has(textDocument.uri.toString()) &&
shouldBeValidated(textDocument)
) {
client.sendNotification(
await client.sendNotification(
DidOpenTextDocumentNotification.type,
client.code2ProtocolConverter.asOpenTextDocumentParams(textDocument)
)
Expand Down Expand Up @@ -441,34 +442,36 @@ export function realActivate (context: ExtensionContext): void {
return false
},
errorHandler: {
error: (error, message, count): ErrorAction => {
return defaultErrorHandler?.error(error, message, count) as ErrorAction
error: (error, message, count): ErrorHandlerResult => {
return defaultErrorHandler?.error(error, message, count) as ErrorHandlerResult
},
closed: (): CloseAction => {
closed: (): CloseHandlerResult => {
if (serverCalledProcessExit) {
return CloseAction.DoNotRestart
return {
action: CloseAction.DoNotRestart
}
}
return defaultErrorHandler?.closed() as CloseAction
return defaultErrorHandler?.closed() as CloseHandlerResult
}
},
middleware: {
didOpen: (document, next) => {
didOpen: async (document, next) => {
if (
Languages.match(packageJsonFilter, document) >= 0 ||
shouldBeValidated(document)
) {
next(document)
await next(document)
syncedDocuments.set(document.uri.toString(), document)
}
},
didChange: (event, next) => {
didChange: async (event, next) => {
if (syncedDocuments.has(event.document.uri.toString())) {
next(event)
await next(event)
}
},
willSave: (event, next) => {
willSave: async (event, next) => {
if (syncedDocuments.has(event.document.uri.toString())) {
next(event)
await next(event)
}
},
willSaveWaitUntil: (event, next) => {
Expand All @@ -478,16 +481,16 @@ export function realActivate (context: ExtensionContext): void {
return Promise.resolve([])
}
},
didSave: (document, next) => {
didSave: async (document, next) => {
if (syncedDocuments.has(document.uri.toString())) {
next(document)
await next(document)
}
},
didClose: (document, next) => {
didClose: async (document, next) => {
const uri = document.uri.toString()
if (syncedDocuments.has(uri)) {
syncedDocuments.delete(uri)
next(document)
await next(document)
}
},
provideCodeActions: (document, range, context, token, next) => {
Expand Down Expand Up @@ -661,7 +664,7 @@ export function realActivate (context: ExtensionContext): void {
updateStatusBarVisibility(Window.activeTextEditor)
})
client
.onReady()
.start()
.then(() => {
client.onNotification(StatusNotification.type, (params) => {
updateStatus(params.state)
Expand Down Expand Up @@ -734,7 +737,6 @@ export function realActivate (context: ExtensionContext): void {
dummyCommands = null
}
context.subscriptions.push(
client.start(),
Commands.registerCommand('standard.executeAutofix', () => {
const textEditor = Window.activeTextEditor
if (textEditor == null) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function main (): Promise<void> {
process.chdir(testWorkspace)
await execShellCommand('npm install')
await runTests({
version: '1.65.0',
version: 'stable',
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [testWorkspace, '--disable-extensions']
Expand Down
Loading

0 comments on commit 3a6d198

Please sign in to comment.