Skip to content

Commit 16c4dc8

Browse files
authored
Merge pull request #76 from blazejkustra/fix/windows-workspace-folder-uri
fix(server): correctly resolve workspace folder URI on Windows
2 parents 6967925 + 5f95a82 commit 16c4dc8

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
| IDE | Installation |
1919
|------|--------------|
20-
| VS Code / Cursor | [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=blazejkustra.react-compiler-marker) \| [Open VSX](https://open-vsx.org/extension/blazejkustra/react-compiler-marker) |
20+
| VS Code / Cursor / Antigravity | [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=blazejkustra.react-compiler-marker) \| [Open VSX](https://open-vsx.org/extension/blazejkustra/react-compiler-marker) |
2121
| WebStorm / IntelliJ IDEA | [IntelliJ marketplace](https://plugins.jetbrains.com/plugin/29540-react-compiler-marker) |
2222
| Neovim | [Setup instructions](packages/nvim-client/README.md) |
2323
| Zed (alpha) | [Setup instructions](packages/zed-client/README.md) |
@@ -68,7 +68,7 @@ npx react-compiler-marker --format json . > report.json
6868

6969
See the [CLI README](packages/cli/README.md) for all options.
7070

71-
### VS Code / Cursor
71+
### VS Code / Cursor / Antigravity
7272

7373
1. Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=blazejkustra.react-compiler-marker) or search "React Compiler Marker" in Extensions
7474
3. Open a React component file - markers appear automatically

packages/server/src/server.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "vscode-languageserver/node";
1414

1515
import { TextDocument } from "vscode-languageserver-textdocument";
16+
import { fileURLToPath } from "node:url";
1617
import {
1718
checkReactCompiler,
1819
getCompiledOutput,
@@ -78,9 +79,11 @@ function logError(error: string): void {
7879
}
7980

8081
connection.onInitialize((params: InitializeParams): InitializeResult => {
81-
workspaceFolder = params.workspaceFolders?.[0]?.uri;
82-
if (workspaceFolder?.startsWith("file://")) {
83-
workspaceFolder = workspaceFolder.slice(7);
82+
const workspaceFolderUri = params.workspaceFolders?.[0]?.uri;
83+
if (workspaceFolderUri?.startsWith("file://")) {
84+
workspaceFolder = fileURLToPath(workspaceFolderUri);
85+
} else {
86+
workspaceFolder = workspaceFolderUri;
8487
}
8588

8689
// Store client name for feature detection

0 commit comments

Comments
 (0)