Skip to content
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

Searching for filepath could redirect to this path #294

Open
tleb opened this issue Jul 3, 2024 · 0 comments
Open

Searching for filepath could redirect to this path #294

tleb opened this issue Jul 3, 2024 · 0 comments

Comments

@tleb
Copy link
Member

tleb commented Jul 3, 2024

Say you search for drivers/cpuidle, no such identifier exists (related #293 bug). In that case, we could check if the path exists and redirect to it if it does.

Currently we get redirected to /linux/latest/A/ident/drivers/cpuidle. We should end up at /linux/latest/source/drivers/cpuidle.

Code that does the 302 redirect is (I think):

elixir/http/web.py

Lines 99 to 102 in fc47224

if ident == '' and ident2:
status = 302
ident2 = parse.quote(ident2.strip())
location = '/'+project+'/'+version+'/'+family2+'/ident/'+ident2

It is weird, the code does not even check that the request is of type POST (as seen in the front-end form).

Now that autocomplete is re-enabled, we could integrate into it. Ideally, that part of autocomplete would be done on the front-end, with a file/dir list available for each (project, version) tuple. Compressed, it should not be too much traffic. And it is easily cache-able.


Idea: we could also match on filename. Say pcm1789, those are the matches:

⟩ fd pcm1789
Documentation/devicetree/bindings/sound/pcm1789.txt
sound/soc/codecs/pcm1789-i2c.c
sound/soc/codecs/pcm1789.c
sound/soc/codecs/pcm1789.h

If you search for pcm1789.c: no symbol is named that way, only one file has that exact name.

To have that working, we should integrate that into autocomplete as well. Autocomplete would have entry types (file, identifier, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant