Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Adding FeatureScript Syntax Support to VSCode

S1monS1mon Member Posts: 4,199 PRO
edited April 29 in FeatureScript

I do a lot of vibe coding of FeatureScript using Codex and VSCode. I've wanted better FeatureScript syntax highlighting support for VSCode. Codex and ChatGPT developed a .VSIX extension which you can install. It knows the syntax and standard library and it will use sticky scrolling to show headers of functions and other blocks while you scroll.

https://github.com/gatrall/featurescript-language-support

image.png

Please follow up here with bug reports or improvement requests.

Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

Comments

  • S1monS1mon Member Posts: 4,199 PRO

    I'm honestly still learning the basics of VSCode, but one of the nice benefits of this FeatureScript aware plugin is that you can navigate by symbols defined in the text (editor or workspace).

    Shift Cmd 0 (for workspace) brings up this menu which is the list of enum, const, function, export, etc.

    image.png

    The text below the filename also gives you breadcrumbs of where you are in the file.

    image.png image.png

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • Konst_ShKonst_Sh Member Posts: 155 PRO
    edited April 30

    This is interesting indeed, if the api integration through public extension will be added together with agentic coding this can boost productivity extensively. Great work, thanks for sharing Simon!

  • Konst_ShKonst_Sh Member Posts: 155 PRO

    Are the "go to definition" and "where used" capabilities not there yet or I'm doing something wrong? Also would be good to have tooltips from symbol docstrings

  • S1monS1mon Member Posts: 4,199 PRO

    Apparently I just needed to ask it to do that too. 0.1.5 version is up on GitHub.

    This works within the file. Adding workspace references will be a next step.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

  • Konst_ShKonst_Sh Member Posts: 155 PRO
    edited May 1

    Works great, thanks! One suggestion - I find the tooltips for enum types that show the full list of variants available in onshape feature studio more useful then how it currently only shows the symbol name and docstring. Also I'm curious what it takes to make autocomplete work for enums and maps? I know the autocomplete is basically all-ai now, but making it more autonomous wouldn't hurt.

    Another thing which bugs me often in onshape editor is that we have a bunch of features like frame(), extrude(), enclose() with no definitition fields documented via docstring, which makes fields auto-complete when typing function call not supported, though this fields info is clearly available in predicate

  • S1monS1mon Member Posts: 4,199 PRO

    I put your comment into Codex verbatim

    image.png

    It came back with a plan and I approved and it just did it.

    image.png image.png image.png

    See GitHub for the latest 0.1.6 release.

    Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.