ocaml / ocaml-lsp

OCaml Language Server Protocol implementation
Other
749 stars 117 forks source link

Unexpected Error: Unknown configuration tag "INDEX" #1339

Open heptarri opened 1 month ago

heptarri commented 1 month ago

When I create a new project following Your First OCaml Program, The vscode editor show me 5 errors:

Unknown configuration tag "INDEX" ocamllsp
Unknown configuration tag "INDEX" ocamllsp
Unknown configuration tag "INDEX" ocamllsp
Unknown configuration tag "SOURCE_ROOT" ocamllsp
Unknown configuration tag "UNIT_NAME" ocamllsp

I don't know weather the ocaml-lsp has something wrong or my configuration is wrong. Looking forward to the solution.

voodoos commented 1 month ago

Thanks for your report @heptarri. What version of OCaml and ocaml-lsp-server are you using ? You can run opam list to show the versions. And opam update && opam upgrade to update. Recent versions of ocaml-lsp-server should either understand these configuration directive or ignore them.

heptarri commented 1 month ago

I have the same error.

When I use opam upgrade to get the new version of ocaml-lsp-server, it said:


The following packages are not being upgraded because the new versions conflict with other installed packages:
  - base.v0.17.1
  - ocaml-config.3
  - ocaml-lsp-server.1.18.0
  - omd.2.0.0~alpha4
  - ppx_yojson_conv_lib.v0.17.0
  - sexplib0.v0.17.0
  - stdio.v0.17.0
  - uucp.15.1.0
  - uuseg.15.1.0
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall
the conflicting packages.
Nothing to do.
voodoos commented 1 month ago

Could you provide the output of opam list ? If you are using a version of ocaml-lsp-server that is older than 1.15.0 it would explain the issue.

mortenhaahr commented 1 month ago

FWIW: Had a similar issue after a fresh installation on Ubuntu 22.04 LTS after running opam update && opam upgrade

Opam upgrade:

Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).

The following packages are not being upgraded because the new versions conflict with other installed packages:
  - base.v0.17.1
  - ocaml-config.3
  - ocaml-lsp-server.1.18.0
  - omd.2.0.0~alpha4
  - ppx_yojson_conv_lib.v0.17.0
  - sexplib0.v0.17.0
  - stdio.v0.17.0
  - uucp.15.1.0
  - uuseg.15.1.0
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the
conflicting packages.
Nothing to do.

Opam list:

# Packages matching: installed
# Name              # Installed # Synopsis
astring             0.8.5       Alternative String module for OCaml
base                v0.15.1     Full standard library replacement for OCaml
base-bigarray       base
base-bytes          base        Bytes library distributed with the OCaml compiler
base-threads        base
base-unix           base
camlp-streams       5.0.1       The Stream and Genlex libraries for use with Camlp4 and Camlp5
camomile            2.0.0       A Unicode library
cmdliner            1.3.0       Declarative definition of command line interfaces for OCaml
cppo                1.6.9       Code preprocessor like cpp for OCaml
crunch              3.3.1       Convert a filesystem into a static OCaml module
csexp               1.5.2       Parsing and printing of S-expressions in Canonical form
dune                3.16.0      Fast, portable, and opinionated build system
dune-build-info     3.16.0      Embed build information inside executable
dune-configurator   3.16.0      Helper library for gathering system configuration
dune-private-libs   3.16.0      Private libraries of Dune
dune-rpc            3.16.0      Communicate with dune using rpc
dune-site           3.16.0      Embed locations information inside executable and libraries
dyn                 3.16.0      Dynamic type
either              1.0.0       Compatibility Either module
fiber               3.7.0       Dune's monadic structured concurrency library
fix                 20230505    Algorithmic building blocks for memoization, recursion, and more
fmt                 0.9.0       OCaml Format pretty-printer combinators
fpath               0.7.3       File system paths for OCaml
host-arch-x86_64    1           OCaml on amd64 (64-bit)
host-system-other   1           OCaml on an unidentified system
lambda-term         3.3.2       Terminal manipulation library for OCaml
logs                0.7.0       Logging infrastructure for OCaml
lwt                 5.7.0       Promises and event-driven I/O
lwt_react           1.2.0       Helpers for using React with Lwt
menhir              20240715    An LR(1) parser generator
menhirCST           20240715    Runtime support library for parsers generated by Menhir
menhirLib           20240715    Runtime support library for parsers generated by Menhir
menhirSdk           20240715    Compile-time library for auxiliary tools related to Menhir
mew                 0.1.0       Modal editing witch
mew_vi              0.5.0       Modal editing witch, VI interpreter
ocaml               4.13.1      The OCaml compiler (virtual package)
ocaml-config        2           OCaml Switch Configuration
ocaml-lsp-server    1.10.5      LSP Server for OCaml
ocaml-system        4.13.1      The OCaml compiler (system version, from outside of opam)
ocaml-version       3.6.7       Manipulate, parse and generate OCaml compiler version strings
ocamlbuild          0.15.0      OCamlbuild is a build system with builtin rules to easily build most OCaml projects
ocamlfind           1.9.6       A library manager for OCaml
ocamlformat         0.26.2      Auto-formatter for OCaml code
ocamlformat-lib     0.26.2      OCaml Code Formatter
ocamlformat-rpc-lib 0.26.2      Auto-formatter for OCaml code (RPC mode)
ocp-indent          1.8.1       A simple tool to indent OCaml programs
ocplib-endian       1.2         Optimised functions to read and write int16/32/64 from strings and bigarrays
octavius            1.2.2       Ocamldoc comment syntax parser
odoc                2.4.2       OCaml Documentation Generator
odoc-parser         2.4.2       Parser for ocaml documentation comments
omd                 1.3.1       A Markdown frontend in pure OCaml.
ordering            3.16.0      Element ordering
pp                  1.2.0       Pretty-printing library
ppx_yojson_conv_lib v0.15.0     Runtime lib for ppx_yojson_conv
ptime               1.1.0       POSIX time for OCaml
re                  1.11.0      RE is a regular expression library for OCaml
react               1.2.2       Declarative events and signals for OCaml
result              1.5         Compatibility Result module
seq                 base        Compatibility package for OCaml's standard iterator type starting from 4.07.
sexplib0            v0.15.1     Library containing the definition of S-expressions and some base converters
spawn               v0.15.1     Spawning sub-processes
stdio               v0.15.0     Standard IO library for OCaml
stdune              3.16.0      Dune's unstable standard library
topkg               1.0.7       The transitory OCaml software packager
trie                1.0.0       Strict impure trie tree
tyxml               4.6.0       A library for building correct HTML and SVG documents
uchar               0.0.2       Compatibility library for OCaml's Uchar module
utop                2.14.0      Universal toplevel for OCaml
uucp                15.0.0      Unicode character properties for OCaml
uuseg               15.0.0      Unicode text segmentation for OCaml
uutf                1.0.3       Non-blocking streaming Unicode codec for OCaml
xdg                 3.16.0      XDG Base Directory Specification
yojson              2.2.2       Yojson is an optimized parsing and printing library for the JSON format
zed                 3.2.3       Abstract engine for text edition in OCaml

Fix:

I executed opam upgrade ocaml-lsp-server which fixed the issue for me.