-
Notifications
You must be signed in to change notification settings - Fork 793
reflecting the scopes and folding in xref generation #1668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ | |
| import org.opensolaris.opengrok.analysis.JFlexXref; | ||
| import org.opensolaris.opengrok.analysis.StreamSource; | ||
| import org.opensolaris.opengrok.configuration.Project; | ||
| import org.opensolaris.opengrok.configuration.RuntimeEnvironment; | ||
| import org.opensolaris.opengrok.history.Annotation; | ||
|
|
||
| /** | ||
|
|
@@ -76,6 +77,8 @@ static protected void writeXref(JFlexXref lxref, Reader in, Writer out, Definiti | |
| lxref.reInit(in); | ||
| lxref.annotation = annotation; | ||
| lxref.project = project; | ||
| lxref.setScopesEnabled(RuntimeEnvironment.getInstance().isScopesEnabled()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I understand this and where the scopes/folding properties are in effect thanks to the inheritance and these lines in So having these properties set into the The only nit I have is that the call to which is not necessary when scopes are disabled. Granted, this method does not do anything however it's a bit of wasted memory. |
||
| lxref.setFoldingEnabled(RuntimeEnvironment.getInstance().isFoldingEnabled()); | ||
| lxref.setDefs(defs); | ||
| lxref.write(out); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><link rel="stylesheet" type="text/css" href="http://localhost:8080/source/default/style.css" /><title>Haskell Xref Test</title></head> | ||
| <body><div id="src"><pre> | ||
| <script type="text/javascript">/* <![CDATA[ */ | ||
| function get_sym_list(){return [["Function","xf",[["x'y'",6]]]];} /* ]]> */</script><a class="l" name="1" href="#1">1</a><span class='fold-space'> </span><span class="c">-- classic quick sort (short but not so efficient)</span> | ||
| <a class="l" name="2" href="#2">2</a><span class='fold-space'> </span><a href="/source/s?defs=qsort" class="intelliWindow-symbol" data-definition-place="undefined-in-file">qsort</a> [] = [] | ||
| <a class="l" name="3" href="#3">3</a><span class='fold-space'> </span><a href="/source/s?defs=qsort" class="intelliWindow-symbol" data-definition-place="undefined-in-file">qsort</a> (<a href="/source/s?defs=x" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x</a>:<a href="/source/s?defs=xs" class="intelliWindow-symbol" data-definition-place="undefined-in-file">xs</a>) = <a href="/source/s?defs=qsort" class="intelliWindow-symbol" data-definition-place="undefined-in-file">qsort</a> [ <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> | <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> <- <a href="/source/s?defs=xs" class="intelliWindow-symbol" data-definition-place="undefined-in-file">xs</a>, <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> < <a href="/source/s?defs=x" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x</a> ] ++ [<a href="/source/s?defs=x" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x</a>] ++ <a href="/source/s?defs=qsort" class="intelliWindow-symbol" data-definition-place="undefined-in-file">qsort</a> [ <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> | <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> <- <a href="/source/s?defs=xs" class="intelliWindow-symbol" data-definition-place="undefined-in-file">xs</a>, <a href="/source/s?defs=x'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x'</a> >= <a href="/source/s?defs=x" class="intelliWindow-symbol" data-definition-place="undefined-in-file">x</a> ] | ||
| <a class="l" name="4" href="#4">4</a><span class='fold-space'> </span> | ||
| <a class="l" name="5" href="#5">5</a><span class='fold-space'> </span><span class="c">-- weird but legal identifiers</span> | ||
| <span id='scope_id_d7e336fa' class='scope-head'><span class='scope-signature'>x'y'null</span><a class="l" name="6" href="#6">6</a><a href="#" onclick='fold(this.parentNode.id)' id='scope_id_d7e336fa_fold_icon'><span class='fold-icon'> </span></a><a href="/source/s?refs=x'y'" class="xf intelliWindow-symbol" data-definition-place="def">x'y'</a> = <b>let</b> <a href="/source/s?defs=f'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">f'</a> = <span class="n">1</span>; <a href="/source/s?defs=g'h" class="intelliWindow-symbol" data-definition-place="undefined-in-file">g'h</a> = <span class="n">2</span> <b>in</b> <a href="/source/s?defs=f'" class="intelliWindow-symbol" data-definition-place="undefined-in-file">f'</a> + <a href="/source/s?defs=g'h" class="intelliWindow-symbol" data-definition-place="undefined-in-file">g'h</a></span> | ||
| <span id='scope_id_d7e336fa_fold' class='scope-body'><a class="l" name="7" href="#7">7</a><span class='fold-space'> </span></span></pre></div></body></html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this fixing any misbehavior ?