the early 2000's <!-- target bean to be referenced by name --> <bean id="testBean" class="org.springframework.beans.TestBean" scope="prototype"> <property name="age" value="10"/> <property name="spouse"> <bean class="org.springframework.beans.TestBean"> <property name="age" value="11"/> </bean> </property> </bean> <!-- will result in 10, which is the value of property 'age' of bean 'testBean' --> <util:property-path id="name" path="testBean.age"/>
ChatGPT don't actually “know" exactly how to use command line tools like GitHub CLI, so they make up command invocations that sound plausible but may or may not exist.
vim-lsp packadd vim-lsp # Use clangd if available if executable('clangd') au User lsp_setup call lsp#register_server({ \ 'name': 'clangd', \ 'cmd': ['clangd'], \ 'allowlist': ['c'], \ }) endif Use the “clangd” command Only enable it on C files
LSP class Reader def initialize @io = $stdin.binmode end def read buffer = @io.gets("\r\n\r\n") content_length = buffer.match(/Content-Length: (\d+)/i)[1].to_i message = @io.read(content_length) JSON.parse message, symbolize_names: true end end end Read Header in to a Buffer Get Content Length Read JSON event and parse
= Writer.new # Handle events subscriber = LSP::Events.new loop do # Read an event message = reader.read # Ask the handler to handle the event subscriber.handle message[:method], message, writer end end end
LSP class Events DISPATCH = { "initialize" => :on_initialize, "textDocument/didSave" => :did_save } def handle method, message, writer send(DISPATCH.fetch(method) { :unknown }, message, writer) end def on_initialize message, writer # ... end end end Map event names to methods Look up methods and call them
= '' if token && token =~ /^([a-z_]+)(_path|_url)$/ # check if it's a route helper if Rails.application.routes.named_routes.key?($1) route = Rails.application.routes.named_routes.get($1) controller = route.requirements[:controller] action = route.requirements[:action] value = "* URI Pattern: `#{route.path.spec}`\n* Controller#Action: `#{controller} ##{action}`" else value = "Something else" end else # Other Stuff end
= '' if token && token =~ /^([a-z_]+)(_path|_url)$/ # check if it's a route helper if Rails.application.routes.named_routes.key?($1) route = Rails.application.routes.named_routes.get($1) controller = route.requirements[:controller] action = route.requirements[:action] value = "* URI Pattern: `#{route.path.spec}`\n* Controller#Action: `#{controller} ##{action}`" else value = "Something else" end else # Other Stuff end
= '' if token && token =~ /^([a-z_]+)(_path|_url)$/ # check if it's a route helper if Rails.application.routes.named_routes.key?($1) route = Rails.application.routes.named_routes.get($1) controller = route.requirements[:controller] action = route.requirements[:action] value = "* URI Pattern: `#{route.path.spec}`\n* Controller#Action: `#{controller} ##{action}`" else value = "Something else" end else # Other Stuff end
to the editor Thread.new do while item = ERROR_QUEUE.pop type, val = *item if type == :clear subscriber.files.each do |file, version| val = { uri: file, version: version, diagnostics: [] } writer.write(method: "textDocument/publishDiagnostics", params: val) end else val[:version] = subscriber.files[val[:uri]] writer.write(method: "textDocument/publishDiagnostics", params: val) end end end