Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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
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
Please follow up here with bug reports or improvement requests.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
Comments
-
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 ofenum,const,function,export, etc.The text below the filename also gives you breadcrumbs of where you are in the file.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
1 -
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!
1 -
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
0 -
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
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
0 -
-
I got syntax checking working but nothing else
0 -
Do you copy-paste the whole thing into onshape to try each new code edit?
0 -
I'm mostly vibe coding at this point. I honestly did the VSIX thing because I wanted to see FS code in VSCode not look weird. And then @Konst_Sh had some more requests and I tried to make it more functional.
For a while I had ChatGPT using the API to update the FeatureScript tab. Then I ran out of API tokens. I'm back to using Browser or Chrome skills to get the FS updated. I make it do the copy/paste for me. I also have it commit to GitHub at the same time.
Onshape is working on a MCP connection so a lot of this will hopefully become unnecessary.Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
1 -
I hope! Even Claude alone is pretty good at FS now.
0 -
@S1mon I know the onshape api well and wouldn't have a problem reading/writing FS code and then sending it out to AI for processing. I wouldn't have a problem versioning it and then reading it back in. I do worry about security and wonder how much Onshape will give up. It freaks me out when chatGPT starts offering up ways to scrap onshape for information.
I'm not sure why your onshape API token is running out. Mine has been running for a long time. It's still running.
I'm not sure why you're running everything through vscode and as localhost? Have you thought about running a server?
I'm using AI to generate a new website, but I'm not asking it to write me a website. AI is much better than googling something and then hanging out at stack overflow looking for answers. An AI prompt for me would be "how do you implement a socket" and then I'll patch that code into my project. I'm stuck on the idea that a prompt like "Make me a cloud cad website similar to onshape" and expecting anything worth while.
Please help me out understand how to prompt the creation of a feature script?
"clean this code up and make it more professional"
"refactor this code into functions with no function longer than 30 lines"
"create me a manipulator function that ca be included into exist code allowing me to easily add manipulators"
What do your prompts look like?
0 -
I used API calls to update FS tabs in Onshape documents. Every code change was a GitHub commit and an update to the FS in Onshape so I could test it. So each update burned API calls. I went through a year’s budget in a couple months. Onshape doesn’t publish pricing to increase the API token budget, so I assumed it wasn’t cheap, and gave up. It really should be a simple web form, not a bunch of emails with sales.
Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
I've never had that issue, are you talking about 100's , 1000's or ? Now I know why you're cut'n & paste'n by scraping browser tabs.
I just downloaded claude desktop. I like that they ask for api keys, or am I asking for problems? I can't image that a dozen api calls to upload FS scripts would cause an issue.
I do want to try and get claude to write a library manipulator function that simplifies using manipulators in feature. Seems like a meaningful task. I'm going to track how much this will cost and if it's easier than writing all the code over and over?
I won't use vscode and will stick to the cloud.
0 -
@S1mon because of your vibcode posts I'm now falling into a deep hole. I'm now into agentic programming using anti-gravity and trying to develop better skills in an .md files trying to define who I am and what my agents should be doing.
I sent my cable.fs to claude and asked it to clean it up and it did. It didn't like that I had constants with no names and changed them to global names to help me remember what they did. On review, the names it came up with were really good because it had deep understanding of what the code did. I got kudos for adding gravity to cables. How does it know that gravity affects cables? that's spooky. Maybe it's buttering me up wanting me to buy more tokens. I found that it gave more compliments than criticism which is a nice thing. claude be nice, don't be mean, that should be in a .md file control project output.
I wouldn't wait for a mcp connection, you can cut-n-paste responses today and generate some bitch'n stuff.
I'm liking AI a lot, at least until it replaces me.
0 -
All of my features since basically the beginning have been either AI assisted or vibe coded wholesale while I wrapped my head around the language. I'm sure some people might call that approach short sighted instead of drilling the fundamentals myself, but these days the results are getting faster and faster and higher quality than I could hope to push out manually. I tend to take on projects of a complexity level that would put my delivery dates back but years if I truly tried to wrap my head around every function in the stack.
Speaking of, got something dropping later this week I know @S1mon is gonna love
1 -
@Derek_Van_Allen_BD no shame using AI, it's the future.
I spent a year writing rustyshed.com 10 years ago. Today, I'm just going to tell AI what I want and build an army of agents.
0















