Open CSchoel opened 5 years ago
Did you remember that the class name is taken from the cursor position inside of Atom? We don't parse anything when we open the documentation. Maybe your cursor was misplaced? It should work if the cursor's position is similar to these 2 examples:
package SHMContraction| "modular and monolithic models of the human cardiac conduction system based on the PhD thesis of H. Seidel"
annotation(Documentation(info="<html>
<p>Contains a modular version of the cardiac conduction system in the
Seidel-Herzel-model (SHM)</p>
</html>"));
end SHMContraction;
or even better somewhere in between the class name:
package SHMCont|raction "modular and monolithic models of the human cardiac conduction system based on the PhD thesis of H. Seidel"
annotation(Documentation(info="<html>
<p>Contains a modular version of the cardiac conduction system in the
Seidel-Herzel-model (SHM)</p>
</html>"));
end SHMContraction;
Having the cursor within the name of the component does fix the original issue, but this is unintuitive behavior. If there is only one class in the file, why should I need to have the cursor on the name of that file in order to open the documentation? Maybe we should have two separate commands: "Mope: Open Documentation" to open the documentation of the Package/Model defined in the current file. And "Mope: Open Documentation from Cursor" (or something similar) to open the documentation of the class that is currently selected.
And then, Mo|E still has major issues in getting the model name right:
PotentialAdapter
in the line extends PotentialAda|pter(v = l2.v);
(| = cursor position), the resulting model name that Mo|E wants to open is PotentialAdapter(v
. I guess the parsing should stop at non-word characters (except for the dot probably).within
declarations in the main model/package of the current file, for import
declarations for submodels, and for models residing in the same package as the current model file that need no import
statement. We need to implement a static name lookup that follows the rules of the Modelica Language Specification section 5.3.This is also connected with #19 .
When trying to open the documentation for this package
Mo|E opens this URL in the browser
http://localhost:9001/mope/project/0/doc?class=%3C/html%3E%22));
which is not exactly helpful. ;)
The same is true for models within a package with varying line numbers from where the supposed class name is parsed.