zanoni-mbdyn / language-mbdyn

Syntax highlighting plugin for MBDyn (https://www.mbdyn.org/) input files
GNU General Public License v3.0
2 stars 1 forks source link

Missing keywords #2

Closed mmorandi closed 3 years ago

mmorandi commented 7 years ago

other node reference denavit hartenberg joint static global

forse reference fa bene a essere di un colore diverso dagli altri, cosi' stacca, ma andrebbe comunque reso colorato per essere sicuri di averlo scritto bene, che ne dici?

zanoni-mbdyn commented 7 years ago

Ciao,

per quanto riguarda "other node", "reference", "denavit hartenberg" e "global" hai ragione: appena ho un attimo di tempo aggiungo l'highlight.

Per quanto invece riguarda invece "joint" e "static", l'highlight è attivo: sei sicuro di avere l'ultima versione installata?

mmorandi commented 7 years ago

On 05/03/2017 09:32 AM, Andrea Zanoni wrote:

Ciao,

per quanto riguarda "other node", "reference", "denavit hartenberg" e "global" hai ragione: appena ho un attimo di tempo aggiungo l'highlight.

Per quanto invece riguarda invece "joint" e "static", l'highlight è attivo: sei sicuro di avere l'ultima versione installata?

Almost sure. Try with

drive caller: JOINT_7, array, 7, element, JOINT_1, joint, string, "rz", linear, 0., K_17G, element, JOINT_2, joint, string, "rz", linear, 0., K_27G, element, JOINT_3, joint, string, "rz", linear, 0., K_37G, element, JOINT_4, joint, string, "rz", linear, 0., K_47G, element, JOINT_5, joint, string, "rz", linear, 0., K_57G, element, JOINT_6, joint, string, "rz", linear, 0., K_67G, element, JOINT_7, joint, string, "rz", linear, 0., K_77*G;

Other missing keywords:

"linear viscoelastic" and "proportional"

Marco

P.S. I'm writing in English because Louis yelled at me....

zanoni-mbdyn commented 7 years ago

OK, now I get where the keywords are missing. Thanks for the feedback, I'll fix it as soon as I can.

Andrea

P.S: yeah, I think Louis has a point :)

zanoni-mbdyn commented 7 years ago

Hi Marco,

can you provide an example in which the "linear viscoelastic" and "proportional" keywords not being highlighted? I've tried pretty much everything that I had in mind but couldn't find a case in which they were not recognised.

Also, for the "reference" issue, it depends on the Syntax Theme (You can set it under Settings->Themes) you use. Unfortunately, not all are the same. For example, If I use the Atom Dark theme, that keyword is highlighted, even if slightly. It I use the theme that I currently prefer, the Base16 Tomorrow Dark theme, it won't be highlighted. It actually belongs to the same category as the begin and end keywords delimiting blocks.

Andrea

mmorandi commented 7 years ago

On 05/12/2017 04:52 PM, Andrea Zanoni wrote:

Hi Marco,

can you provide an example in which the "linear viscoelastic" and "proportional" keywords not being highlighted? I've tried pretty much everything that I had in mind but couldn't find a case in which they were not recognised.

Here it is:

joint: JOINT_1 + 1, deformable axial joint,
    GROUND,
        position, reference, GROUND, null,
        orientation, reference, GROUND, eye,
    LINK_1,
        position, reference, GROUND, null,
        orientation, reference, GROUND, eye,
    linear viscoelastic, KP_1, proportional, DAMP;

it highlights "linear" but not "viscoelastic" in the joint definition, and "proportional" is not highlighted.

Also, for the "reference" issue, it depends on the Syntax Theme (You can set it under |Settings->Themes|) you use. Unfortunately, not all are the same. For example, If I use the |Atom Dark| theme, that keyword is highlighted, even if slightly. It I use the theme that I currently prefer, the |Base16 Tomorrow Dark| theme, it won't be highlighted.

I understand now.

It actually belongs to the same category as the |begin| and |end| keywords delimiting blocks.

Do you mean keyword.other.mbdyn ?

Where do you specify how a given category should be rendered? I'm (slowly) trying to find my way through the atom's customization syntax; it is a little overkill for MBDyn's needs. I mean, in my previous editor (nedit) I had to specify only these categories

single line comment comment numeric constant left keyword right keyword math keyword

zanoni-mbdyn commented 7 years ago

I am quite puzzled because if I paste your snippet, I get this: immagine

zanoni-mbdyn commented 7 years ago

Do you mean keyword.other.mbdyn ?

yes

Where do you specify how a given category should be rendered? I'm (slowly) trying to find my way through the atom's customization syntax; it is a little overkill for MBDyn's needs.

It is in grammars/mbdyn.cson. I agree that is a bit of an overkill, but Atom allows very easy implementation of the autocompletion, that's why I choose it. Other than that, the syntax highlighting is complex because it allows for complicated colorschemes, but they are rarely implemented in full in the themes (the reference keyword is an example of that common behavior)...

mmorandi commented 7 years ago

On 05/12/2017 05:42 PM, Andrea Zanoni wrote:

I am quite puzzled because if I paste your snippet, I get this: immagine https://cloud.githubusercontent.com/assets/7814088/26005775/64829858-373a-11e7-82a0-fcb5ffd90348.png

while I get this..

However, I've just checked, and the packages are up to date. I have no clue.

zanoni-mbdyn commented 7 years ago

Anyway, I have fixed a couple of the things that you noticed. I have pushed a new patch release, maybe I had some fixes just in the repo and not in the official release.

Would you mind to update and test it again? Thanks

Andrea

mmorandi commented 7 years ago

On 05/12/2017 05:51 PM, Andrea Zanoni wrote:

Anyway, I have fixed a couple of things that you noticed. I have pushed a new patch release, maybe I had some fix just in the repo and not in the official release.

I think so. Now it works, see the attached image.

How can I change the color of keywords like "reference"? I mean, I think that somewhere (but I was not able to find where) you had to specify that a given category of keyword had to be rendered according to a certain style, that is specified differently for different themes. I would like to choose a different style, so that the keyword is colored, regardless of the theme chosen.

zanoni-mbdyn commented 7 years ago

Unfortunately, I don't think that is possible. At least, I don't know how to do it.

As I understand it, the Syntax Theme decides which kind of keywords (which categories) are colored and which are not, and how. Maybe to do that you'd have to define your own Syntax Theme.

I still haven't found a completely satisfying Syntax Theme, to be honest. Some of them are really good, but something seems to be missing every time...