makicamel / rails-routes-navigator

Display Routes of Rails, search incremental and navigate to the source location
MIT License
4 stars 3 forks source link

No routes generated #2

Open polyglotdev opened 2 years ago

polyglotdev commented 2 years ago

Just wondering if I am missing something because I have routes in my routes.rb, but none show in extention tab?

makicamel commented 2 years ago

Thank you for your report! Do you have any error messages like:

polyglotdev commented 2 years ago

Nothing generated as an error but I will see whats in the console for VS Code in the AM

polyglotdev commented 2 years ago

This is the error in developer tools in VS Code 👇🏾

Refused to load the script 'vscode-resource:/Users/dom-hashicorp/.vscode-insiders/extensions/makicamel.rails-routes-navigator-0.1.0/media/script.js' because it violates the following Content Security Policy directive: "script-src 'self' https://*.vscode-cdn.net 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
polyglotdev commented 2 years ago
rails-routes-vscode

That's what did render 👆🏾 in VS Code

andyjeffries commented 1 year ago

I get exactly the same as @polyglotdev above (and have done for a while).

eljuanchosf commented 1 year ago

Hello @makicamel ! Thank you for this extension. I'm currently seeing the same problem as @andyjeffries. Is there any chance you can get to it at anytime? Thank you!

joevin-slq-docto commented 1 year ago

Many many cases are not handled in the parse function of routes.ts. Regex must be more refined like in this extension : https://github.com/basgren/railways/blob/master/src/net/bitpot/railways/parser/RailsRoutesParser.java. For example, if you have any route that uses redirect(), it will crash.

andyjeffries commented 11 months ago

I get the same thing on a fairly new Rails 7.1 app that has a pretty minimal routes.rb file.

Rails.application.routes.draw do
  # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

  # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
  # Can be used by load balancers and uptime monitors to verify that the app is live.
  get "up" => "rails/health#show", as: :rails_health_check

  get "login" => "sessions#new", as: :login
  post "login" => "sessions#create"
  delete "logout" => "sessions#destroy", as: :logout

  resource :budget
  resources :groups
  resources :categories # may not be needed
  resources :period_categories
  resources :investments
  resources :debts
  resource :net_worth
  resources :transactions
  resources :settings

  # Defines the root path route ("/")
  root "budget#index"
end
andyjeffries commented 11 months ago

From a brief look at the code, it appears to be that it really doesn't support Rails restful resources. I tried to change the code to use "bundle exec rails routes -E" which gives a more parseable output of all generated routes but I'm really nowhere near experienced enough in TypeScript or VSCode extensions to debug it enough.

MrKirat commented 11 months ago
rails-routes-vscode

That's what did render 👆🏾 in VS Code

Same here

heyitscoco commented 1 month ago

fwiw I'm having the same problem still :/