@pandacss/language-server 0.0.0-dev-20230607205019
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/CHANGELOG.md +7 -0
- package/LICENSE.md +21 -0
- package/Roboto-Medium.ttf +0 -0
- package/dist/index.js +46760 -0
- package/index.ts +1 -0
- package/package.json +49 -0
- package/src/builder-resolver.ts +82 -0
- package/src/capabilities.ts +25 -0
- package/src/features/color-hints.ts +68 -0
- package/src/features/completion.ts +34 -0
- package/src/features/diagnostics.ts +93 -0
- package/src/features/hover.ts +79 -0
- package/src/features/index.ts +5 -0
- package/src/features/inlay-hints.ts +61 -0
- package/src/index.ts +130 -0
- package/src/setup-builder.ts +252 -0
- package/src/tokens/color2k-to-vscode-color.ts +18 -0
- package/src/tokens/error.ts +3 -0
- package/src/tokens/expand-token-fn.ts +43 -0
- package/src/tokens/generate-keyframe-css.ts +28 -0
- package/src/tokens/is-color.ts +216 -0
- package/src/tokens/render-font-size-preview.ts +49 -0
- package/src/tokens/render-token-color-preview.ts +63 -0
- package/src/tokens/setup-tokens-helpers.ts +601 -0
- package/src/tokens/utils.ts +82 -0
- package/src/uri-to-path.ts +38 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { URI } from 'vscode-uri'
|
|
2
|
+
|
|
3
|
+
const RE_PATHSEP_WINDOWS = /\\/g
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns an fs path the uri of a TextDocument.
|
|
7
|
+
*/
|
|
8
|
+
export function uriToPath(stringUri: string): string | undefined {
|
|
9
|
+
const uri = URI.parse(stringUri)
|
|
10
|
+
if (uri.scheme !== 'file') {
|
|
11
|
+
return undefined
|
|
12
|
+
}
|
|
13
|
+
return normalizeFsPath(uri.fsPath)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function fsPathToUri(fsPath: string): string {
|
|
17
|
+
return URI.file(fsPath).toString()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Normalizes the file system path.
|
|
22
|
+
*
|
|
23
|
+
* On systems other than Windows it should be an no-op.
|
|
24
|
+
*
|
|
25
|
+
* On Windows, an input path in a format like "C:/path/file.ts"
|
|
26
|
+
* will be normalized to "c:/path/file.ts".
|
|
27
|
+
*/
|
|
28
|
+
export function normalizePath(filePath: string): string {
|
|
29
|
+
const fsPath = URI.file(filePath).fsPath
|
|
30
|
+
return normalizeFsPath(fsPath)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Normalizes the path obtained through the "fsPath" property of the URI module.
|
|
35
|
+
*/
|
|
36
|
+
export function normalizeFsPath(fsPath: string): string {
|
|
37
|
+
return fsPath.replace(RE_PATHSEP_WINDOWS, '/')
|
|
38
|
+
}
|