@master/css-language-server 2.0.0-rc.19 → 2.0.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/serve.cjs CHANGED
@@ -136,7 +136,7 @@ function serve() {
136
136
  line: position.line + 100,
137
137
  character: 0
138
138
  }) ?? undefined;
139
- const inMasterCSS = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings.classMatch).IsMatch;
139
+ const checkResult = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings.classMatch);
140
140
  const lineText = document.getText({
141
141
  start: {
142
142
  line: position.line,
@@ -148,7 +148,7 @@ function serve() {
148
148
  }
149
149
  }).trim();
150
150
  const lastInstance = cssLanguageService.getLastInstance(lineText, position, language);
151
- if (lastInstance.isInstance == true && inMasterCSS == true) {
151
+ if (lastInstance.isInstance == true && checkResult) {
152
152
  return cssLanguageService.getCompletionItem(lastInstance.lastKey, lastInstance.triggerKey, lastInstance.isStart, lastInstance.language, css$1);
153
153
  } else if (lastInstance.isInstance == true && cssLanguageService.checkConfigColorsBlock(document, textDocumentPosition.position) == true) {
154
154
  return cssLanguageService.getConfigColorsCompletionItem(css$1);
@@ -210,8 +210,8 @@ function serve() {
210
210
  line: params.range.start.line + 100,
211
211
  character: 0
212
212
  }) ?? undefined;
213
- const isColorRender = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, colorRender);
214
- return cssLanguageService.getColorPresentation(params, isColorRender.IsMatch);
213
+ const checkResult = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, colorRender);
214
+ return cssLanguageService.getColorPresentation(params, checkResult !== null);
215
215
  }
216
216
  }
217
217
  return [];
@@ -231,9 +231,9 @@ function serve() {
231
231
  line: position.line + 100,
232
232
  character: 0
233
233
  }) ?? undefined;
234
- const HoverInstance = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings.classMatch);
235
- if (HoverInstance.IsMatch) {
236
- return cssLanguageService.doHover(HoverInstance.instance.instanceString, indexToRange(HoverInstance.instance.index, document), customConfig);
234
+ const checkResult = cssLanguageService.positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings.classMatch);
235
+ if (checkResult) {
236
+ return cssLanguageService.doHover(checkResult.instanceContent, indexToRange(checkResult.index, document), customConfig);
237
237
  }
238
238
  }
239
239
  }
package/dist/serve.mjs CHANGED
@@ -134,7 +134,7 @@ function serve() {
134
134
  line: position.line + 100,
135
135
  character: 0
136
136
  }) ?? undefined;
137
- const inMasterCSS = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings$1.classMatch).IsMatch;
137
+ const checkResult = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings$1.classMatch);
138
138
  const lineText = document.getText({
139
139
  start: {
140
140
  line: position.line,
@@ -146,7 +146,7 @@ function serve() {
146
146
  }
147
147
  }).trim();
148
148
  const lastInstance = getLastInstance(lineText, position, language);
149
- if (lastInstance.isInstance == true && inMasterCSS == true) {
149
+ if (lastInstance.isInstance == true && checkResult) {
150
150
  return getCompletionItem(lastInstance.lastKey, lastInstance.triggerKey, lastInstance.isStart, lastInstance.language, css);
151
151
  } else if (lastInstance.isInstance == true && checkConfigColorsBlock(document, textDocumentPosition.position) == true) {
152
152
  return getConfigColorsCompletionItem(css);
@@ -208,8 +208,8 @@ function serve() {
208
208
  line: params.range.start.line + 100,
209
209
  character: 0
210
210
  }) ?? undefined;
211
- const isColorRender = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, colorRender);
212
- return getColorPresentation(params, isColorRender.IsMatch);
211
+ const checkResult = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, colorRender);
212
+ return getColorPresentation(params, checkResult !== null);
213
213
  }
214
214
  }
215
215
  return [];
@@ -229,9 +229,9 @@ function serve() {
229
229
  line: position.line + 100,
230
230
  character: 0
231
231
  }) ?? undefined;
232
- const HoverInstance = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings$1.classMatch);
233
- if (HoverInstance.IsMatch) {
234
- return doHover(HoverInstance.instance.instanceString, indexToRange(HoverInstance.instance.index, document), customConfig);
232
+ const checkResult = positionCheck(text.substring(startIndex, endIndex), positionIndex, startIndex, settings$1.classMatch);
233
+ if (checkResult) {
234
+ return doHover(checkResult.instanceContent, indexToRange(checkResult.index, document), customConfig);
235
235
  }
236
236
  }
237
237
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css-language-server","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","type-check":"tsc --noEmit","lint":"eslint src","test":"jest"},"description":"Master CSS Language Server","author":"Aoyue Design LLC.","license":"MIT","repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/language-server"},"dependencies":{"@master/css":"^2.0.0-rc.19","@master/css-language-service":"^2.0.0-rc.19","explore-config":"^3.0.16","js-beautify":"^1.15.1","minimatch":"^9.0.3","vscode-languageserver":"^7.0.0","vscode-languageserver-textdocument":"^1.0.11"},"sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.mjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"version":"2.0.0-rc.19"}
1
+ {"name":"@master/css-language-server","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","type-check":"tsc --noEmit","lint":"eslint src","test":"jest"},"description":"Master CSS Language Server","author":"Aoyue Design LLC.","license":"MIT","repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/language-server"},"dependencies":{"@master/css":"^2.0.0-rc.20","@master/css-language-service":"^2.0.0-rc.20","explore-config":"^3.0.16","js-beautify":"^1.15.1","minimatch":"^9.0.3","vscode-languageserver":"^7.0.0","vscode-languageserver-textdocument":"^1.0.11"},"sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.mjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"files":["dist"],"publishConfig":{"access":"public","provenance":true},"version":"2.0.0-rc.20"}