dparkins / language-fortran

Syntax highlighting for FORTRAN for atom
MIT License
35 stars 16 forks source link

"Go to Declaration" does not work #75

Open filipenevola opened 8 years ago

filipenevola commented 8 years ago

"Go to Declaration" does not work

tomedunn commented 8 years ago

Which grammar are you working with? Fortran - Free Form or Fortran - Fixed Form? Can you provide a screen shot? Thanks!

filipenevola commented 8 years ago

Both does not work.

screenshot at jan 18 21-33-26

Is this screenshot enough?

tomedunn commented 8 years ago

I don't see anything wrong in that image... What did you expect it to look like?

filipenevola commented 8 years ago

I don't know why do you want an imagem hehe.

But my problem is: I can't navigate to this subroutine declaration with "Go to Declaration".

The "Go to Declaration" feature works or not?

tomedunn commented 8 years ago

Ah, I see. I'm not sure if that's a feature that can be addressed in a language grammar but I'll look into it. It would certainly be nice to have. :smile:

tomedunn commented 8 years ago

It looks like the goto declaration option is controlled by https://github.com/atom/symbols-view. If you use ctrl + r does that let you navigate between declarations? Are you able to get this feature to work with any other languages?

filipenevola commented 8 years ago

In Fortran don't but in Javascript yes with this package.

https://atom.io/packages/goto

But it is slow sometimes :(

tomedunn commented 8 years ago

Awesome! I'll look through those to see if there is a simple way of extending this language package to work with it.

tomedunn commented 8 years ago

I finally got around to looking into this and the results don't look that great. The goto package works by looking for specific scopes: entity.name.type.class, entity.name.function, and entity.other.attribute-name.class. Changing the scope names in the grammar to work with this is easy enough to do but it completely throws off the coloring schema for the language. As it stands subroutines already work, and derived types already can be easily modified to work as well. However function and other variables are where the problem lies. I'm not sure I'm OK with making it harder to distinguish variables from subroutines and functions.

filipenevola commented 8 years ago

hmmm. Can you add more types like class, function? Maybe it is easy to add subroutine and other types.

zrhans commented 8 years ago

Hi I have a gfortran installed in my windows. Is it difficult to create (program) a menu item with comand to use gfortran to compile and run the code?

tomedunn commented 8 years ago

@zrhans the build package for Atom can probably handle this sort of thing.

tomedunn commented 8 years ago

@filipenevola it would be easy for me to make goto work for derived types and for subroutines (from my testing it already works for subroutines). However there is no easy way to make it work for functions without causing issues with non-function variables. I'll look through language-javascript sometime next week to see if they're are doing something specific that make it work better for them.

filipenevola commented 8 years ago

@tomedunn ok, if you need help please let me know. I'm new in Atom plugins but maybe I can help.