discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Getting a list of openscad and BOSL2 function/module signatures

JL
Jamie Larkby-Lahet
Thu, Feb 20, 2025 3:32 PM

Thanks! i hadn't seen that.  turns out there is a pull request for adding
an LSP implementation to openscad itself:
https://github.com/openscad/openscad/pull/3635

which is the 'real' real fix :P

looks like the is neovim support for the LSP I'm using if that appeals to
you at all.

On Thu, Feb 20, 2025, 03:24 Roel Vanhout roel.vanhout@gmail.com wrote:

Thanks all. I guess going the proper LSP based way is the 'real' fix after
all. But after spending almost the entire day yesterday getting the lsp vim
plugin to work with the openscad-lsp server, to the point where I installed
a Rust toolchain and the dev versions of all tools involved just so I could
add trace statements to understand what was going on and still coming up
short, I was reminded of those times the past where I tried to make vim do
things beyond what can be reasonably expected from it. Installing VS Code
and installing the vim mode and openscad LSP extensions took less than 10
minutes and worked out of the box (including library completions), so I
guess switching editors is the pragmatic solution.

James: I assume you're using openscad-lsp as the server from Emacs? Maybe
you already know, but you can pass --ignore-default to it to not auto
complete default arguments. Of course then you lose all arguments with
default values, i.e. you'll hardly get any arguments suggested any more.

regards

On Tue, Feb 18, 2025 at 8:51 PM James Larkby-Lahet jamesbuyacar@gmail.com
wrote:

no, although the original poster is using vim. for the openscad editor i
think adding LSP support could be a reasonable way to get support for
arbitrary included files, not just BOSL.

although, I'm not a fan of the way emacs autopopulates parameter names
(with their default arguments) since it is common to ignore arguments in
scad. but I don't think that is inherent to the Language Server Protocol.

On Tue, Feb 18, 2025, 13:35 jon jonbondy.com jon@jonbondy.com wrote:

James:

Does this really apply to the editor that is built into OpenSCAD?

Thanks!

Jon
On 2/18/2025 11:19 AM, James Larkby-Lahet wrote:

I think all you need is an openscad LSP (language server) and an editor
with LSP support.

I use https://github.com/Leathong/openscad-LSP with emacs.

On Tue, Feb 18, 2025, 06:43 Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

I use the built-in OpenSCAD editor, which has a kind of auto-complete.
Would it be possible to add BOSL2 features to that?

Jon

On 2/18/2025 5:00 AM, Roel Vanhout via Discuss wrote:

Hello all,

I was fed up yesterday with having to look up module signatures

(exact

names of arguments etc) so often, so I looked into setting up auto
complete (or at least completion suggestions and inline

documentation)

inside Vim. This turned out to be quite a rabbit hole and a reminder
of why I no longer like to mess with convoluted setups, but after
reminding myself a few times to just get back to the basics and look
for a MVP only I now have a way where completion suggestions are read
from a simple text file (using vim-complete). So now all I need is a
list of openscad and BOSL2 modules and functions with their arguments
in a flat text file.

For openscad itself I can get away with just copy/pasting the
cheatsheet and fixing up manually as that pretty much covers my needs
for this specific use case, and that's a 10 minute job. For BOSL2

this

is obviously not an option because of the sheer amount of
functionality. So now my question is whether there is someone who's
already done something similar that I can leverage. BOSL2 seems to be
documented very cleanly and using a very strict format, so I could
just make a simple program to search for all lines that start with
'Usage:' and then read the next indented lines. Even if there would

be

some issues in the formatting here or there, a 90% solution would be
fine with me. But still, maybe there are already more robust and
elaborate solutions to this issue that I could either use, re-use or
contribute to? Thanks.

(I seem to remember this topic having come up on this list some years
ago but I can't seem to find it? Maybe I'm just not remembering right)

regards

Roel


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks! i hadn't seen that. turns out there is a pull request for adding an LSP implementation to openscad itself: https://github.com/openscad/openscad/pull/3635 which is the 'real' real fix :P looks like the is neovim support for the LSP I'm using if that appeals to you at all. On Thu, Feb 20, 2025, 03:24 Roel Vanhout <roel.vanhout@gmail.com> wrote: > Thanks all. I guess going the proper LSP based way is the 'real' fix after > all. But after spending almost the entire day yesterday getting the lsp vim > plugin to work with the openscad-lsp server, to the point where I installed > a Rust toolchain and the dev versions of all tools involved just so I could > add trace statements to understand what was going on and still coming up > short, I was reminded of those times the past where I tried to make vim do > things beyond what can be reasonably expected from it. Installing VS Code > and installing the vim mode and openscad LSP extensions took less than 10 > minutes and worked out of the box (including library completions), so I > guess switching editors is the pragmatic solution. > > James: I assume you're using openscad-lsp as the server from Emacs? Maybe > you already know, but you can pass --ignore-default to it to not auto > complete default arguments. Of course then you lose all arguments with > default values, i.e. you'll hardly get any arguments suggested any more. > > regards > > > On Tue, Feb 18, 2025 at 8:51 PM James Larkby-Lahet <jamesbuyacar@gmail.com> > wrote: > >> no, although the original poster is using vim. for the openscad editor i >> think adding LSP support could be a reasonable way to get support for >> arbitrary included files, not just BOSL. >> >> although, I'm not a fan of the way emacs autopopulates parameter names >> (with their default arguments) since it is common to ignore arguments in >> scad. but I don't think that is inherent to the Language Server Protocol. >> >> On Tue, Feb 18, 2025, 13:35 jon jonbondy.com <jon@jonbondy.com> wrote: >> >>> James: >>> >>> Does this really apply to the editor that is built into OpenSCAD? >>> >>> Thanks! >>> >>> Jon >>> On 2/18/2025 11:19 AM, James Larkby-Lahet wrote: >>> >>> I think all you need is an openscad LSP (language server) and an editor >>> with LSP support. >>> >>> I use https://github.com/Leathong/openscad-LSP with emacs. >>> >>> On Tue, Feb 18, 2025, 06:43 Jon Bondy via Discuss < >>> discuss@lists.openscad.org> wrote: >>> >>>> I use the built-in OpenSCAD editor, which has a kind of auto-complete. >>>> Would it be possible to add BOSL2 features to that? >>>> >>>> Jon >>>> >>>> On 2/18/2025 5:00 AM, Roel Vanhout via Discuss wrote: >>>> > Hello all, >>>> > >>>> > I was fed up yesterday with having to look up module signatures >>>> (exact >>>> > names of arguments etc) so often, so I looked into setting up auto >>>> > complete (or at least completion suggestions and inline >>>> documentation) >>>> > inside Vim. This turned out to be quite a rabbit hole and a reminder >>>> > of why I no longer like to mess with convoluted setups, but after >>>> > reminding myself a few times to just get back to the basics and look >>>> > for a MVP only I now have a way where completion suggestions are read >>>> > from a simple text file (using vim-complete). So now all I need is a >>>> > list of openscad and BOSL2 modules and functions with their arguments >>>> > in a flat text file. >>>> > >>>> > For openscad itself I can get away with just copy/pasting the >>>> > cheatsheet and fixing up manually as that pretty much covers my needs >>>> > for this specific use case, and that's a 10 minute job. For BOSL2 >>>> this >>>> > is obviously not an option because of the sheer amount of >>>> > functionality. So now my question is whether there is someone who's >>>> > already done something similar that I can leverage. BOSL2 seems to be >>>> > documented very cleanly and using a very strict format, so I could >>>> > just make a simple program to search for all lines that start with >>>> > 'Usage:' and then read the next indented lines. Even if there would >>>> be >>>> > some issues in the formatting here or there, a 90% solution would be >>>> > fine with me. But still, maybe there are already more robust and >>>> > elaborate solutions to this issue that I could either use, re-use or >>>> > contribute to? Thanks. >>>> > >>>> > (I seem to remember this topic having come up on this list some years >>>> > ago but I can't seem to find it? Maybe I'm just not remembering right) >>>> > >>>> > regards >>>> > >>>> > Roel >>>> > >>>> > >>>> > _______________________________________________ >>>> > OpenSCAD mailing list >>>> > To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>>> -- >>>> This email has been checked for viruses by AVG antivirus software. >>>> www.avg.com >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>>