Skip to content

Commit 0dbd314

Browse files
authored
Merge pull request #124 from agentic-labs/csharp
Csharp support
2 parents 587c130 + 671d4a3 commit 0dbd314

31 files changed

Lines changed: 1454 additions & 28 deletions

lsproxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lsproxy"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
edition = "2021"
55

66
[lib]

lsproxy/Dockerfile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,17 @@ ENV PATH="/opt/jdtls/bin:${PATH}"
6767
RUN rustup component add rust-analyzer
6868
RUN rustup component add rustfmt
6969

70+
# Install coverage tools
71+
RUN cargo install cargo-llvm-cov
72+
RUN rustup component add llvm-tools-preview
73+
7074
# Install jedi python language server, ast grep for tree sitter
7175
RUN pip install jedi-language-server ast-grep-cli
7276

7377
# Install global npm packages
7478
RUN npm install -g typescript-language-server typescript
7579

7680
# Install go and Gopls
77-
7881
ARG TARGETARCH
7982
RUN curl -O -L "https://go.dev/dl/go1.23.5.linux-${TARGETARCH}.tar.gz" && \
8083
tar -C /usr/local -xzf go1.23.5.linux-${TARGETARCH}.tar.gz && \
@@ -83,7 +86,7 @@ RUN curl -O -L "https://go.dev/dl/go1.23.5.linux-${TARGETARCH}.tar.gz" && \
8386
cp ~/go/bin/gopls /usr/bin/gopls
8487

8588
ENV GOROOT=/usr/local/go
86-
ENV GOPATH=/root/go
89+
ENV GOPATH=/home/user/go
8790
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
8891

8992
# Install ruby and ruby-lsp
@@ -93,9 +96,25 @@ RUN apt update && apt install -y ruby-full \
9396

9497
RUN gem install ruby-lsp
9598

96-
# Install coverage tools
97-
RUN cargo install cargo-llvm-cov
98-
RUN rustup component add llvm-tools-preview
99+
ENV HOME=/home/user
100+
101+
# Download and run dotnet install script
102+
RUN curl -fsSL https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh -o dotnet-install.sh \
103+
&& chmod +x dotnet-install.sh \
104+
&& ./dotnet-install.sh --channel 8.0 --install-dir /home/user/.dotnet \
105+
&& ./dotnet-install.sh --channel 9.0 --install-dir /home/user/.dotnet \
106+
&& rm dotnet-install.sh
107+
108+
# Add .NET to PATH
109+
ENV PATH="${PATH}:/home/user/.dotnet"
110+
ENV DOTNET_ROOT=/home/user/.dotnet
111+
112+
# Install csharp-ls globally
113+
RUN dotnet tool install --global csharp-ls
114+
115+
# Add .NET tools to PATH
116+
ENV PATH="${PATH}:/home/user/.dotnet/tools"
117+
99118

100119
COPY Cargo.toml .
101120

lsproxy/src/api_types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ pub enum SupportedLanguages {
7676
Rust,
7777
#[serde(rename = "cpp")]
7878
CPP,
79+
#[serde(rename = "csharp")]
80+
CSharp,
7981
#[serde(rename = "java")]
8082
Java,
8183
#[serde(rename = "golang")]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
id: all-identifiers
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
id: class-instantiation
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
inside:
7+
kind: object_creation_expression
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
id: function-call
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
any:
7+
- inside:
8+
kind: invocation_expression
9+
- inside:
10+
kind: member_access_expression
11+
field: name
12+
inside:
13+
kind: invocation_expression
14+
- inside:
15+
kind: generic_name
16+
inside:
17+
kind: member_access_expression
18+
inside:
19+
kind: invocation_expression
20+
- inside:
21+
kind: generic_name
22+
inside:
23+
kind: invocation_expression
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
id: class
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
inside:
7+
kind: class_declaration
8+
pattern: $CONTEXT
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
id: enum
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
inside:
7+
kind: enum_declaration
8+
pattern: $CONTEXT
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: field
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
any:
7+
- inside:
8+
kind: variable_declarator
9+
inside:
10+
kind: variable_declaration
11+
inside:
12+
kind: field_declaration
13+
pattern: $CONTEXT
14+
- inside:
15+
kind: variable_declaration
16+
inside:
17+
kind: event_field_declaration
18+
pattern: $CONTEXT
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
id: interface
2+
language: csharp
3+
rule:
4+
kind: identifier
5+
pattern: $NAME
6+
inside:
7+
kind: interface_declaration
8+
pattern: $CONTEXT

0 commit comments

Comments
 (0)