Skip to content

Commit c181c7c

Browse files
committed
add: bicep lsp support for micro
1 parent df0bebe commit c181c7c

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

images/aks-dotnet.Containerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ FROM ghcr.io/queil/image:latest
22

33
USER root
44

5+
# bicep language server requries dotnet 8.0
56
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
6-
microdnf install -y dotnet-sdk-9.0 helm --nodocs --setopt install_weak_deps=0 && \
7+
microdnf install -y dotnet-sdk-8.0 helm --nodocs --setopt install_weak_deps=0 && \
78
microdnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm --nodocs --setopt install_weak_deps=0 && \
89
microdnf install -y azure-cli --nodocs --setopt install_weak_deps=0 && \
910
microdnf clean all && rm -rf /var/cache/yum && \
@@ -18,17 +19,22 @@ ENV DOTNET_CLI_TELEMETRY_OPTOUT=true
1819
ENV DOTNET_NOLOGO=true
1920
ENV PATH="${PATH}:${HOME}/.dotnet/tools"
2021

21-
RUN code-server --install-extension Ionide.Ionide-fsharp && \
22-
code-server --install-extension ms-azuretools.vscode-bicep
22+
ARG BICEP_LSP_VER=0.38.5
23+
ARG BICEP_WRAPPER_PATH=$HOME/.local/bin/bicep-lsp
2324

24-
RUN dotnet tool install --global fsy --version 0.20.0-alpha.2 && \
25+
RUN code-server --accept-server-license-terms --install-extension Ionide.Ionide-fsharp && \
26+
code-server --accept-server-license-terms --install-extension "ms-azuretools.vscode-bicep@${BICEP_LSP_VER}" && \
27+
echo '#!/bin/bash' > $BICEP_WRAPPER_PATH && \
28+
echo "exec dotnet ${HOME}/.vscode-server/extensions/ms-azuretools.vscode-bicep-${BICEP_LSP_VER}/bicepLanguageServer/Bicep.LangServer.dll \"$@\"" >> $BICEP_WRAPPER_PATH && \
29+
chmod +x $BICEP_WRAPPER_PATH
30+
31+
RUN dotnet tool install --global fsy --version 0.20.0 && \
2532
dotnet tool install -g fsautocomplete && \
2633
dotnet tool install -g fantomas && fsy install-fsx-extensions
2734

2835
RUN mkdir -p ~/.config/micro/plug/lsp && \
2936
git clone -b fsharp https://github.com/queil/micro-plugin-lsp.git ~/.config/micro/plug/lsp
3037

31-
3238
ARG KUSTOMIZE_VER=5.7.1
3339
ARG KUBESEAL_VER=0.32.2
3440
ARG ARGO_WF_VER=3.7.2
@@ -41,8 +47,5 @@ RUN eget kubernetes-sigs/kustomize --tag="v${KUSTOMIZE_VER}" && \
4147
eget argoproj/argo-cd --tag="${ARGO_CD_VER}" && \
4248
eget stern/stern --tag="${STERN_VER}"
4349

44-
ENV USER=queil
45-
ENV HOME=/home/$USER
46-
4750
RUN echo 'alias k=kubectl' >> $HOME/.image.bashrc && \
4851
echo 'alias kb="kustomize build"' >> $HOME/.image.bashrc

init/home/queil/.config/micro/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"clipboard": "terminal",
1010
"colorscheme": "material-tc",
1111
"diffgutter": true,
12-
"lsp.server": "fsharp=fsautocomplete --adaptive-lsp-server-enabled --project-graph-enabled={\"fsiExtraParameters\":[\"--compilertool:/home/queil/.fsharp/fsx-extensions/.fsch\"]}",
12+
"lsp.server": "bicep=bicep-lsp,fsharp=fsautocomplete --adaptive-lsp-server-enabled --project-graph-enabled={\"fsiExtraParameters\":[\"--compilertool:/home/queil/.fsharp/fsx-extensions/.fsch\"]}",
1313
"mkparents": true,
1414
"tabstospaces": true
1515
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
filetype: bicep
2+
3+
detect:
4+
filename: "\\.bicep$"
5+
6+
rules:
7+
- type: "\\b(param|var|resource|output|module|targetScope|import|func|type|metadata)\\b"
8+
- statement: "\\b(if|for|existing)\\b"
9+
- identifier: "\\b(true|false|null)\\b"
10+
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
11+
- comment: "//.*"
12+
- comment:
13+
start: "/\\*"
14+
end: "\\*/"
15+
rules: []
16+
- constant.number: "\\b[0-9]+\\b"
17+
- symbol.operator: "[-+*/=<>!&|?:]"
18+
- symbol.brackets: "[(){}\\[\\]]"
19+
- preproc: "@[a-zA-Z_][a-zA-Z0-9_]*"

0 commit comments

Comments
 (0)