ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109957] [Ruby master Feature#19011] Improve LSP support in CRuby development itself
@ 2022-09-19 16:26 tenderlovemaking (Aaron Patterson)
  2022-11-10  9:42 ` [ruby-core:110679] " kjtsanaktsidis (KJ Tsanaktsidis)
  2022-11-10 11:35 ` [ruby-core:110680] " eightbitraptor (Matthew Valentine-House)
  0 siblings, 2 replies; 3+ messages in thread
From: tenderlovemaking (Aaron Patterson) @ 2022-09-19 16:26 UTC (permalink / raw)
  To: ruby-core

Issue #19011 has been reported by tenderlovemaking (Aaron Patterson).

----------------------------------------
Feature #19011: Improve LSP support in CRuby development itself
https://bugs.ruby-lang.org/issues/19011

* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Priority: Normal
----------------------------------------
I would like to add a new configure option for improve working with language servers inside CRuby itself.

The summary is like this:

```
$ ./autogen.sh
$ ./configure --enable-compile-commands
$ make -j compile_commands.json
# Now use LSP
```

`clangd` uses `compile_commands.json` to understand how to compile files inside CRuby.  We can use `clang` itself to generate this file, but we have to pass special compile options to clang.  Unfortunately the compile options generate many small JSON files, so we also need a way to concatenate them in to `compile_commands.json`.

Ideally I would like `make miniruby` to build `miniruby` *and* `compile_commands.json`, but I don't know how to do that yet. 😅

I've send a patch [here](https://github.com/ruby/ruby/pull/6352)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:110679] [Ruby master Feature#19011] Improve LSP support in CRuby development itself
  2022-09-19 16:26 [ruby-core:109957] [Ruby master Feature#19011] Improve LSP support in CRuby development itself tenderlovemaking (Aaron Patterson)
@ 2022-11-10  9:42 ` kjtsanaktsidis (KJ Tsanaktsidis)
  2022-11-10 11:35 ` [ruby-core:110680] " eightbitraptor (Matthew Valentine-House)
  1 sibling, 0 replies; 3+ messages in thread
From: kjtsanaktsidis (KJ Tsanaktsidis) @ 2022-11-10  9:42 UTC (permalink / raw)
  To: ruby-core

Issue #19011 has been updated by kjtsanaktsidis (KJ Tsanaktsidis).


I've been using Bear https://github.com/rizsotto/Bear for this - running `bear -- make` generates a _passable_ compile_commands.json file that sort-of works. It doesn't handle some of the trickier things though, e.g. files like vm_insnhelper.c which are not themselves compiled as a translation unit, but rather `#include`'d in vm.c. So having some better built-in support for this in the cruby development toolchain would be ace.

----------------------------------------
Feature #19011: Improve LSP support in CRuby development itself
https://bugs.ruby-lang.org/issues/19011#change-100022

* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Priority: Normal
----------------------------------------
I would like to add a new configure option for improve working with language servers inside CRuby itself.

The summary is like this:

```
$ ./autogen.sh
$ ./configure --enable-compile-commands
$ make -j compile_commands.json
# Now use LSP
```

`clangd` uses `compile_commands.json` to understand how to compile files inside CRuby.  We can use `clang` itself to generate this file, but we have to pass special compile options to clang.  Unfortunately the compile options generate many small JSON files, so we also need a way to concatenate them in to `compile_commands.json`.

Ideally I would like `make miniruby` to build `miniruby` *and* `compile_commands.json`, but I don't know how to do that yet. 😅

I've send a patch [here](https://github.com/ruby/ruby/pull/6352)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:110680] [Ruby master Feature#19011] Improve LSP support in CRuby development itself
  2022-09-19 16:26 [ruby-core:109957] [Ruby master Feature#19011] Improve LSP support in CRuby development itself tenderlovemaking (Aaron Patterson)
  2022-11-10  9:42 ` [ruby-core:110679] " kjtsanaktsidis (KJ Tsanaktsidis)
@ 2022-11-10 11:35 ` eightbitraptor (Matthew Valentine-House)
  1 sibling, 0 replies; 3+ messages in thread
From: eightbitraptor (Matthew Valentine-House) @ 2022-11-10 11:35 UTC (permalink / raw)
  To: ruby-core

Issue #19011 has been updated by eightbitraptor (Matthew Valentine-House).


kjtsanaktsidis (KJ Tsanaktsidis) wrote in #note-1:
> I've been using Bear https://github.com/rizsotto/Bear for this - running `bear -- make` generates a _passable_ compile_commands.json file that sort-of works. It doesn't handle some of the trickier things though, e.g. files like vm_insnhelper.c which are not themselves compiled as a translation unit, but rather `#include`'d in vm.c. So having some better built-in support for this in the cruby development toolchain would be ace.

I've also been using `bear` to do this, but then running the resultant compilation db through [compdb](https://github.com/Sarcasm/compdb) with 

```
compdb -p . list > compile_commands2.json && mv compile_commands2.json compile_commands.json
```

(assuming `.` is the directory that contains `compile_commands.json`)

This parses the original compilation database and produces a new one with headers included.

I Appreciate it's another step to take, but hopefully useful until we can provide a better experience.

----------------------------------------
Feature #19011: Improve LSP support in CRuby development itself
https://bugs.ruby-lang.org/issues/19011#change-100023

* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Priority: Normal
----------------------------------------
I would like to add a new configure option for improve working with language servers inside CRuby itself.

The summary is like this:

```
$ ./autogen.sh
$ ./configure --enable-compile-commands
$ make -j compile_commands.json
# Now use LSP
```

`clangd` uses `compile_commands.json` to understand how to compile files inside CRuby.  We can use `clang` itself to generate this file, but we have to pass special compile options to clang.  Unfortunately the compile options generate many small JSON files, so we also need a way to concatenate them in to `compile_commands.json`.

Ideally I would like `make miniruby` to build `miniruby` *and* `compile_commands.json`, but I don't know how to do that yet. 😅

I've send a patch [here](https://github.com/ruby/ruby/pull/6352)



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-10 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 16:26 [ruby-core:109957] [Ruby master Feature#19011] Improve LSP support in CRuby development itself tenderlovemaking (Aaron Patterson)
2022-11-10  9:42 ` [ruby-core:110679] " kjtsanaktsidis (KJ Tsanaktsidis)
2022-11-10 11:35 ` [ruby-core:110680] " eightbitraptor (Matthew Valentine-House)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).