diff --git a/packages/language-server/src/serve.ts b/packages/language-server/src/serve.ts index c5e34fa9a..cd8f5e14c 100644 --- a/packages/language-server/src/serve.ts +++ b/packages/language-server/src/serve.ts @@ -201,7 +201,7 @@ export default function serve() { if (settings == null) { return [] } - if (settings.previewColors == true && CheckFilesExclude(documentColor.textDocument.uri)) { + if (settings.previewColors && CheckFilesExclude(documentColor.textDocument.uri)) { const documentUri = documentColor.textDocument.uri const document = documents.get(documentUri) if (document) { @@ -210,10 +210,10 @@ export default function serve() { return [] } - const colorIndexs = (await getDocumentColors(text, css)) + const colorIndexes = (await getDocumentColors(text, css)) const colorIndexSet = new Set() - const colorInformations = colorIndexs + const colorInformation = colorIndexes .filter(item => { if (colorIndexSet.has(item.index.start)) { return false @@ -230,14 +230,14 @@ export default function serve() { color: x.color })) - return colorInformations + return colorInformation } } return [] }) connection.onColorPresentation((params: ColorPresentationParams) => { - if (settings.previewColors == true && CheckFilesExclude(params.textDocument.uri)) { + if (settings.previewColors && CheckFilesExclude(params.textDocument.uri)) { const document = documents.get(params.textDocument.uri) if (document) { const text = document.getText()