adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.26k stars 7.63k forks source link

[quick edit] in HTML file, quick editor shows function found from other file, not one in current file #3942

Closed jodyzhang closed 11 years ago

jodyzhang commented 11 years ago
  1. load brackets folder, open '/brackets/src/extensions/default/JavaScriptCodeHints/unittest-files/basic-test-files/index.html'
  2. put cursor on function fo<cursor>o, press command +E ->first it is slow, not showing up till try command+E couple times, then editor shows up, but it doesn't check function defined in current scope, instead it finds out quite lists(guess it searches, then returns list of suggestion).

However in this case, it should be simple detection, can we do better?

njx commented 11 years ago

Looks like this only happens in HTML files. Edited description to reflect this.

njx commented 11 years ago

Reviewed. Marking low priority, to @eztierney.

eztierney commented 11 years ago

@jodyzhang I'm unable to reproduce this with the latest brackets - maybe it's been fixed?

jodyzhang commented 11 years ago

I can't get quick editor showing up on foo() in this case, I assume they change functionality?

eztierney commented 11 years ago

Oh, oops, I was doing jump-to-def.

Yeah, I don't see quick edit working anyways - I'd think it would since jump-to-def works.

jeffkenton commented 11 years ago

Actually, the jump-to-definition part is working, but then it feeds the resulting filename to the old QuickEdit code in order to get the desired function location better than Tern does. The QuickEdit solution -- JSUtils.findMatchingFunctions -- strips out files that don't have .js extensions.

I'll fix it.

njx commented 11 years ago

FBNC @jodyzhang

jodyzhang commented 11 years ago

verified, now it finds local method, closed it.