dmarc3 / vscode-nastran

Nastran Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=mbakke.vscode-nastran&ssr=false
MIT License
9 stars 3 forks source link

Question in regards to syntax highlighting of f04, f06 files #83

Open FGHaider opened 6 months ago

FGHaider commented 6 months ago

Hi, so I was thinking that I might give it a try, to do the f04, f06 syntax highlighting, but I am a bit unsure where to look for a reference, could you point me in the correct direction?

In addition to syntax highlighting, I also thought it might be nice to add error/warning detection, so that you can see from the explorer immidiately if it contains errors and or warnings. Then use CTRL+SHIFT+M to explore the issues.

dmarc3 commented 6 months ago

Hey @FGHaider , there is a stale f06 branch which you could start from. We'll need to rebase off of the current dev branch since it's a bit behind. In terms of a reference:

  1. Do you mean a reference on how to highlight things in the extension?
    • Checkout the f06.json file in the syntaxes folder. vscode extensions use TextMate Grammars and a lot of regex to make things work.
  2. Or do you mean a reference on the f04 and f06 formats and things we should highlight?
    • I unfortunately do not have a good reference for this. MSC's documentation is lacking so my approach was just sifting through .f06 files I have access to to decide what should be highlighted. The pyNastran repository has a lot of runnable Nastran models which you could use to generate some .f06 files to use for this purpose.

In addition to syntax highlighting, I also thought it might be nice to add error/warning detection, so that you can see from the explorer immidiately if it contains errors and or warnings. Then use CTRL+SHIFT+M to explore the issues.

I think this is a great idea. Let me know if you need any help... my time is a bit limited right now but I've been adding to this when I can. Also, it's hidden in the CONTRIBUTING.md file but there is also a discord server which I monitor if you want to reach out through there. Link here.

dmarc3 commented 6 months ago

I was contemplating sifting through the NASTRAN-95 repository to see if I can gleam any helpful f06 information but MSC Nastran has probably deviated from it such that it wouldn't be helpful... plus it's Fortran which I do not know 😞

FGHaider commented 6 months ago

Thank you for then info! I'll use the branch as a starting point and see if I can find some nice place to use as reference (or try to understand Fortran...).