Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration for Swift-MesonLSP #123

Merged
merged 1 commit into from
Oct 2, 2023
Merged

Conversation

JCWasmx86
Copy link
Contributor

@JCWasmx86 JCWasmx86 commented Apr 6, 2023

See #119

Features

  • Download and setup binaries for MacOS/Windows (For windows: Requires a zip file due to depending on some DLLs that can't be statically linked)
    • Download binaries
    • Check checksum
    • Extract zip file (Requires external library)
    • Make lsp.ts use the downloaded file
  • Code style/Formatting
  • Figure out if something went wrong with yarn.lock and if yes what went wrong (Doesn't seem to be something bad)
  • Get rid of curl usage to download file
  • Don't require users to restart VSCode
  • Add language server to https://langserver.org/ ? (See Add to langserver.org JCWasmx86/mesonlsp#11)

@JCWasmx86 JCWasmx86 force-pushed the main branch 6 times, most recently from 3989544 to 55db2c0 Compare April 9, 2023 07:17
@JCWasmx86 JCWasmx86 marked this pull request as ready for review April 9, 2023 07:21
@JCWasmx86
Copy link
Contributor Author

JCWasmx86 commented Apr 9, 2023

I think this is ready for review.

Automatic updates are currently not implemented as I don't know what the best way would be.

This adds a few dependencies:

  • which to find the language server on the path
  • adm-zip to extract the downloaded zip

lsp.ts is based a bit on the Vala VSCode extension (MIT)

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/lsp.ts Outdated Show resolved Hide resolved
src/lsp.ts Outdated Show resolved Hide resolved
@tristan957
Copy link
Contributor

The clangd, codeql, rust analyzer extensions might be good to look at for inspiration on auto updating.

package.json Outdated Show resolved Hide resolved
src/lsp.ts Outdated Show resolved Hide resolved
src/lsp.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
@JCWasmx86
Copy link
Contributor Author

JCWasmx86 commented Sep 7, 2023

Run tsc --noEmit --noErrorTruncation --pretty false
Error: src/utils.ts(31,33): error TS2322: Type 'ExecFileException | undefined' is not assignable to type 'ExecException | undefined'.
  Type 'ExecFileException' is not assignable to type 'ExecException | undefined'.
    Type 'ExecFileException' is not assignable to type 'ExecException'.
      Types of property 'code' are incompatible.
        Type 'string | number | null | undefined' is not assignable to type 'number | undefined'.
          Type 'null' is not assignable to type 'number | undefined'.
Error: Process completed with exit code 2.

Not sure why exactly it breaks, but I broke it (Albeit I haven't touched the file)

I've fixed it, but it requires changing unrelated code

@tristan957
Copy link
Contributor

tristan957 commented Sep 7, 2023

Did you rebase on master? Some new workflows and things got added

@JCWasmx86
Copy link
Contributor Author

Yes, already reformatted everything

@JCWasmx86
Copy link
Contributor Author

JCWasmx86 commented Sep 7, 2023

I've accidentally bumped the @types/node version during fixing conflicts, but it's fixed now

@tristan957
Copy link
Contributor

Ha. Thanks for rebasing :).

package.json Outdated Show resolved Hide resolved
@JCWasmx86
Copy link
Contributor Author

JCWasmx86 commented Oct 1, 2023

I've bumped to 2.4.4 a version that has a few auto-completion improvements. For this release there won't be any improvements to the formatting of tooltips during hovering.

But I think for now it's good enough to merge this PR

@tristan957 tristan957 merged commit 60dc5f7 into mesonbuild:main Oct 2, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants