Open navinp0304 opened 1 month ago
Care to submit a PR ?
@vladak Yes but why aren't the include files clickable (without href) even after adding suffixes. I'll have that and then submit PR.
@vladak Yes but why aren't the include files clickable (without href) even after adding suffixes. I'll have that and then submit PR.
Hi @vladak , can you please help with this ?
For the include directive I think this needs to be processed by the Fortran analyzer. I believe https://github.com/oracle/opengrok/blob/master/opengrok-indexer/src/main/jflex/analysis/fortran/FortranSymbolTokenizer.lex needs to obtain similar rule as e.g. in https://github.com/oracle/opengrok/blob/0e0e613f0e7824b129796f77d024a0455d659ed9/opengrok-indexer/src/main/jflex/analysis/c/CSymbolTokenizer.lex#L54 , just with the single quotes surrounding the file path element.
Is the file include a feature of (modern) Fortran actually ? Just asking, I have never worked with Fortran before.
The Fortran lexing rules already contain file/path matching: https://github.com/oracle/opengrok/blob/0e0e613f0e7824b129796f77d024a0455d659ed9/opengrok-indexer/src/main/jflex/analysis/fortran/FortranXref.lex#L166-L184 and there is also https://github.com/oracle/opengrok/blob/0e0e613f0e7824b129796f77d024a0455d659ed9/opengrok-indexer/src/main/jflex/analysis/fortran/FortranXref.lex#L89-L96 so perhaps these need to be augmented and/or receive rule similar to the one used for C: https://github.com/oracle/opengrok/blob/0e0e613f0e7824b129796f77d024a0455d659ed9/opengrok-indexer/src/main/jflex/analysis/c/CXref.lex#L98-L113 (which should match the rule added to FortranSymbolTokenizer.lex)
Further, there is also https://github.com/oracle/opengrok/blob/0e0e613f0e7824b129796f77d024a0455d659ed9/opengrok-indexer/src/main/jflex/analysis/fortran/FortranXref.lex#L62 which probably needs to be reconciled with the new state of include files in Fortran.
For the include directive I think this needs to be processed by the Fortran analyzer. I believe https://github.com/oracle/opengrok/blob/master/opengrok-indexer/src/main/jflex/analysis/fortran/FortranSymbolTokenizer.lex needs to obtain similar rule as e.g. in
, just with the single quotes surrounding the file path element. Is the file include a feature of (modern) Fortran actually ? Just asking, I have never worked with Fortran before.
No it was there since Fortran 77 include 'file' or include "file" . Below is the link https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vna1/index.html
Care to submit a PR ?
Submitted
How do i make #include 'file.i' as clickable i.e it is showing as text not a link ? For me #include "file.h" works as a clickable link. I tried adding it in suffix but it doesn't work. The format is #include 'file.i' not "file.i".
Ctags has added support for fortran identifiers with $ https://github.com/universal-ctags/ctags/issues/4033
Please add support for opengrok as well. This works well for me.