borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
557 stars 20 forks source link

Removes detected symbols from javascript code (requires additional space character) #264

Open alexp1917 opened 3 years ago

alexp1917 commented 3 years ago

When writing a class in javascript, the expected behavior is that when you write some code like:

function My() { this.value = arguments[0] || 1; }
My.prototype.method = function() {
  return this.value;
};

then press Ctrl+R in sublime text, then you will see two symbols that are navigable to.

However, the actual behavior is that unless there is a space as below, then the method is not found. it looks like this only an issue in ST4, and the ClassName.prototype. is not part of the detected symbol. so please don't shoot the messenger, but it feels like its worth reporting.

-My.prototype.method = function() {
+My.prototype.method = function () {

By the way, when disabling this plugin, the space is no longer necessary. So the problem, as i see it, is ultimately that this plugin interferes with ST4's ability to find symbols in js code (probably due to st4, but ive lost a lot of time already figuring out whats wrong with ST4 that i havent checked this, but i can spend more time on this if necessary).