oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.35k stars 747 forks source link

Plsql and Javascript not contains label "in" #3482

Open elkin5 opened 3 years ago

elkin5 commented 3 years ago

Description

When I realize a search in a java file the result expose label "in", but, when I realize a search in a plsql file the result don`t expose label "in"

e.g:

The same happens for javascript !!

vladak commented 3 years ago

If this is a file with PLSQL I wonder if it has been indexed as such. I am asking because the PLSQL analyzer does not have the .PKG suffix listed there: https://github.com/oracle/opengrok/blob/4271459588af01aec552b5c4cb65a11274783a3b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/sql/PLSQLAnalyzerFactory.java#L32-L39

and I do not see it listed in other analyzers either:

# /jdk/openjdk11/bin/java -jar /opengrok/dist/lib/opengrok.jar -h guru | grep -i pkg
Mar 16, 2021 5:50:25 PM org.opengrok.indexer.index.Indexer parseOptions
INFO: Indexer options: [-h, guru]
#

This is with 1.6.3. Unless you are running the indexer with -A, --analyzer to assign the .PKG suffix to PLSQL analyzer the file will be likely indexed as plain text file. The indexer logs will tell you more. What happens if you search for the frfGetChildAddrId as definition ?

elkin5 commented 3 years ago
elkin5 commented 3 years ago

Do you explain me how add this info to Opengrok?

tarzanek commented 3 years ago

hmm, this should be possible with having the -A to add ctags definitions besides analyzer detection(which just does highlight/lexical analysis but ctags do semantics) there was a bug for improving option -A (and I think part of above got ev. fixed that ctags will detect semantics even for stuff added manually with -A)

tarzanek commented 3 years ago

hmm, so just highlighter needs to acknowledge -A too?

vladak commented 3 years ago

First thing I'd check is scope of the function definition.

elkin5 commented 3 years ago

It is not a problem that has to do with the -A option, it is a general problem, I have tested the languages: plsql, javascript, typescript, java and csharp and so far the label in is only available for csharp and java, there is no other that allows me to identify the context of a search.

I was seeing that they had csharp and java in common and that they had different with respect to Plsql and Javascript and the first thing that I find different is the definition of the .lex files

elkin5 commented 3 years ago

If you want I can attach a screenshot of all the languages that I have tried

elkin5 commented 3 years ago

I need to know documentation of the architecture to see if I can help in this problem, is there a link where I show the architecture of the indexer?