@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.
@@ -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
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": ["src", "index.ts"],
4
+ "compilerOptions": {
5
+ "tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo"
6
+ }
7
+ }