Git Product home page Git Product logo

Comments (5)

sidkshatriya avatar sidkshatriya commented on June 21, 2024 1

Interestingly, I tried the lexical with kak-lsp a few days ago too and could not get it to work either.

Lexical works fine with helix incidently so it would seem the issue is with kak-lsp + kakoune.

Debugging tip: Lexical lsp logs are stored in .lexical directory created in your project root. It shows an error but I dont know what it means.

from kakoune-lsp.

zetashift avatar zetashift commented on June 21, 2024

Ah, right, yea it(lexical) works for me in helix as well, but well you never know.

Here is the .lexical/lexical.log:

```

** (FunctionClauseError) no function clause matching in LXical.Server.Configuration.apply_config_change/2
(lx_server 0.5.0) lib/lexical/server/configuration.ex:95: LXical.Server.Configuration.apply_config_change(%LXical.Server.Configuration{project: %LXical.Project{root_uri: "file:///tmp/repro01", mix_exs_uri: "file:///tmp/repro01/mix.exs", mix_project?: true, mix_env: nil, mix_target: nil, env_variables: %{}, project_module: nil, entropy: 28755}, support: %LXical.Server.Configuration.Support{code_action_dynamic_registration: false, hierarchical_symbols: true, snippet: true, deprecated: false, tags: false, signature_help: #Protocol.Types.SignatureHelp.ClientCapabilities<[context_support: false, dynamic_registration: false, signature_information: #Protocol.Types.SignatureHelp.ClientCapabilities.SignatureInformation<[documentation_format: [:plain_text], parameter_information: #Protocol.Types.SignatureHelp.ClientCapabilities.ParameterInformation<[label_offset_support: false]>]>]>, work_done_progress: true}, client_name: "kakoune-lsp", additional_watched_extensions: nil, dialyzer_enabled?: false}, nil)
(lx_server 0.5.0) lib/lexical/server/state.ex:134: LXical.Server.State.apply/2
(lx_server 0.5.0) lib/lexical/server.ex:153: LXical.Server.apply_to_state/2
(lx_server 0.5.0) lib/lexical/server.ex:125: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:protocol_message, %LXical.Protocol.Notifications.DidChangeConfiguration{lsp: %LXical.Protocol.Notifications.DidChangeConfiguration.LSP{jsonrpc: "2.0", method: "workspace/didChangeConfiguration", settings: nil}, jsonrpc: "2.0", method: "workspace/didChangeConfiguration", settings: nil}}}
State: %LXical.Server.State{configuration: %LXical.Server.Configuration{project: %LXical.Project{root_uri: "file:///tmp/repro01", mix_exs_uri: "file:///tmp/repro01/mix.exs", mix_project?: true, mix_env: nil, mix_target: nil, env_variables: %{}, project_module: nil, entropy: 28755}, support: %LXical.Server.Configuration.Support{code_action_dynamic_registration: false, hierarchical_symbols: true, snippet: true, deprecated: false, tags: false, signature_help: #Protocol.Types.SignatureHelp.ClientCapabilities<[context_support: false, dynamic_registration: false, signature_information: #Protocol.Types.SignatureHelp.ClientCapabilities.SignatureInformation<[documentation_format: [:plain_text], parameter_information: #Protocol.Types.SignatureHelp.ClientCapabilities.ParameterInformation<[label_offset_support: false]>]>]>, work_done_progress: true}, client_name: "kakoune-lsp", additional_watched_extensions: nil, dialyzer_enabled?: false}, initialized?: true, shutdown_received?: false, in_flight_requests: %{}}
12:29:57.580 [error] Process LXical.Server (#PID<0.140.0>) terminating
** (FunctionClauseError) no function clause matching in LXical.Server.Configuration.apply_config_change/2
(lx_server 0.5.0) lib/lexical/server/configuration.ex:95: LXical.Server.Configuration.apply_config_change(%LXical.Server.Configuration{project: %LXical.Project{root_uri: "file:///tmp/repro01", mix_exs_uri: "file:///tmp/repro01/mix.exs", mix_project?: true, mix_env: nil, mix_target: nil, env_variables: %{}, project_module: nil, entropy: 28755}, support: %LXical.Server.Configuration.Support{code_action_dynamic_registration: false, hierarchical_symbols: true, snippet: true, deprecated: false, tags: false, signature_help: #Protocol.Types.SignatureHelp.ClientCapabilities<[context_support: false, dynamic_registration: false, signature_information: #Protocol.Types.SignatureHelp.ClientCapabilities.SignatureInformation<[documentation_format: [:plain_text], parameter_information: #Protocol.Types.SignatureHelp.ClientCapabilities.ParameterInformation<[label_offset_support: false]>]>]>, work_done_progress: true}, client_name: "kakoune-lsp", additional_watched_extensions: nil, dialyzer_enabled?: false}, nil)
(lx_server 0.5.0) lib/lexical/server/state.ex:134: LXical.Server.State.apply/2
(lx_server 0.5.0) lib/lexical/server.ex:153: LXical.Server.apply_to_state/2
(lx_server 0.5.0) lib/lexical/server.ex:125: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Initial Call: LXical.Server.init/1
Ancestors: [LXical.Server.Supervisor, #PID<0.137.0>]
Message Queue Length: 14
Messages: ["$gen_cast": {:protocol_message, %LXical.Protocol.Notifications.DidOpen{lsp: %LXical.Protocol.Notifications.DidOpen.LSP{jsonrpc: "2.0", method: "textDocument/didOpen", text_document: #Protocol.Types.TextDocument.Item<[language_id: "elixir", text: "defmodule Repro01Web do\n @moduledoc """\n The entrypoint for defining your web interface, such\n as controllers, components, channels, and so on.\n\n This can be used in your application as:\n\n use Repro01Web, :controller\n use Repro01Web, :html\n\n The definitions below will be executed for every controller,\n component, etc, so keep them short and clean, focused\n on imports, uses and aliases.\n\n Do NOT define functions inside the quoted expressions\n below. Instead, define additional modules and import\n those modules here.\n """\n\n def static_paths, do: ~w(assets fonts images favicon.ico robots.txt)\n\n def router do\n quote do\n use Phoenix.Router, helpers: false\n\n # Import common connection and controller functions to use in pipelines\n import Plug.Conn\n import Phoenix.Controller\n import Phoenix.LiveView.Router\n end\n end\n\n def channel do\n quote do\n use Phoenix.Channel\n end\n end\n\n def controller do\n quote do\n use Phoenix.Controller,\n formats: [:html, :json],\n layouts: [html: Repro01Web.Layouts]\n\n import Plug.Conn\n import Repro01Web.Gettext\n\n unquote(verified_routes())\n end\n end\n\n def live_view do\n quote do\n use Phoenix.LiveView,\n layout: {Repro01Web.Layouts, :app}\n\n unquote(html_helpers())\n end\n end\n\n def live_component do\n quote do\n use Phoenix.LiveComponent\n\n unquote(html_helpers())\n end\n end\n\n def html do\n quote do\n use Phoenix.Component\n\n # Import convenience functions from controllers\n import Phoenix.Controller,\n only: [get_csrf_token: 0, view_module: 1, view_template: 1]\n\n # Include general helpers for rendering HTML\n unquote(html_helpers())\n end\n end\n\n defp html_helpers do\n quote do\n # HTML escaping functionality\n import Phoenix.HTML\n # Core UI components and translation\n import Repro01Web.CoreComponents\n import Repro01Web.Gettext\n\n # Shortcut for generating JS commands\n alias Phoenix.LiveView.JS\n\n # Routes generation with the ~p sigil\n unquote(verified_routes())\n end\n end\n\n def verified_routes do\n quote do\n use Phoenix.VerifiedRoutes,\n endpoint: Repro01Web.Endpoint,\n router: Repro01Web.Router,\n statics: Repro01Web.static_paths()\n end\n end\n\n @doc """\n When used, dispatch to the appropriate controller/view/etc.\n """\n defmacro using(which) when is_atom(which) do\n apply(MODULE, which, [])\n end\nend\n", uri: "file:///tmp/repro01/lib/repro01_web.ex", version: 1]>}, document: nil, jsonrpc: "2.0", method: "textDocument/didOpen", text_document: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.CodeLens{lsp: %LXical.Protocol.Requests.CodeLens.LSP{id: 2, jsonrpc: "2.0", method: "textDocument/codeLens", partial_result_token: nil, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, id: 2, jsonrpc: "2.0", method: "textDocument/codeLens", partial_result_token: nil, text_document: nil, work_done_token: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 3, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 0, line: 0]>, start: #Protocol.Types.Position<[character: 0, line: 0]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 3, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.DocumentSymbols{lsp: %LXical.Protocol.Requests.DocumentSymbols.LSP{id: 4, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, id: 4, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: nil, work_done_token: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 5, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 0, line: 1]>, start: #Protocol.Types.Position<[character: 0, line: 1]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 5, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.DocumentSymbols{lsp: %LXical.Protocol.Requests.DocumentSymbols.LSP{id: 6, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, id: 6, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: nil, work_done_token: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Notifications.Cancel{lsp: %LXical.Protocol.Notifications.Cancel.LSP{jsonrpc: "2.0", method: "$/cancelRequest", id: 5}, jsonrpc: "2.0", method: "$/cancelRequest", id: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Req (truncated)
12:29:57.623 [error] Child LXical.Server of Supervisor LXical.Server.Supervisor terminated
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in LXical.Server.Configuration.apply_config_change/2
(lx_server 0.5.0) lib/lexical/server/configuration.ex:95: LXical.Server.Configuration.apply_config_change(%LXical.Server.Configuration{project: %LXical.Project{root_uri: "file:///tmp/repro01", mix_exs_uri: "file:///tmp/repro01/mix.exs", mix_project?: true, mix_env: nil, mix_target: nil, env_variables: %{}, project_module: nil, entropy: 28755}, support: %LXical.Server.Configuration.Support{code_action_dynamic_registration: false, hierarchical_symbols: true, snippet: true, deprecated: false, tags: false, signature_help: #Protocol.Types.SignatureHelp.ClientCapabilities<[context_support: false, dynamic_registration: false, signature_information: #Protocol.Types.SignatureHelp.ClientCapabilities.SignatureInformation<[documentation_format: [:plain_text], parameter_information: #Protocol.Types.SignatureHelp.ClientCapabilities.ParameterInformation<[label_offset_support: false]>]>]>, work_done_progress: true}, client_name: "kakoune-lsp", additional_watched_extensions: nil, dialyzer_enabled?: false}, nil)
(lx_server 0.5.0) lib/lexical/server/state.ex:134: LXical.Server.State.apply/2
(lx_server 0.5.0) lib/lexical/server.ex:153: LXical.Server.apply_to_state/2
(lx_server 0.5.0) lib/lexical/server.ex:125: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Pid: #PID<0.140.0>
Start Call: LXical.Server.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker
12:29:57.628 [info] Child LXical.Server of Supervisor LXical.Server.Supervisor started
Pid: #PID<0.164.0>
Start Call: LXical.Server.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker
12:30:35.610 [info] Compiled repro01 in 38.1 seconds
13:12:46.380 [error] GenServer LXical.Server terminating
** (FunctionClauseError) no function clause matching in LXical.Server.Provider.Queue.add/2
(lx_server 0.5.0) lib/lexical/server/provider/queue.ex:171: LXical.Server.Provider.Queue.add(%LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 7, line: 29]>, start: #Protocol.Types.Position<[character: 7, line: 29]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}, nil)
(lx_server 0.5.0) lib/lexical/server.ex:141: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:protocol_message, %LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 7, line: 29]>, start: #Protocol.Types.Position<[character: 7, line: 29]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}}}
State: %LXical.Server.State{configuration: nil, initialized?: false, shutdown_received?: false, in_flight_requests: %{}}
13:12:46.392 [error] Process LXical.Server (#PID<0.164.0>) terminating
** (FunctionClauseError) no function clause matching in LXical.Server.Provider.Queue.add/2
(lx_server 0.5.0) lib/lexical/server/provider/queue.ex:171: LXical.Server.Provider.Queue.add(%LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 7, line: 29]>, start: #Protocol.Types.Position<[character: 7, line: 29]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}, nil)
(lx_server 0.5.0) lib/lexical/server.ex:141: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Initial Call: LXical.Server.init/1
Ancestors: [LXical.Server.Supervisor, #PID<0.137.0>]
Message Queue Length: 2
Messages: ["$gen_cast": {:protocol_message, %LXical.Protocol.Notifications.Cancel{lsp: %LXical.Protocol.Notifications.Cancel.LSP{jsonrpc: "2.0", method: "$/cancelRequest", id: 10}, jsonrpc: "2.0", method: "$/cancelRequest", id: nil}}, "$gen_cast": {:protocol_message, %LXical.Protocol.Requests.DocumentSymbols{lsp: %LXical.Protocol.Requests.DocumentSymbols.LSP{id: 12, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, id: 12, jsonrpc: "2.0", method: "textDocument/documentSymbol", partial_result_token: nil, text_document: nil, work_done_token: nil}}]
Links: [#PID<0.138.0>]
Dictionary: []
Trapping Exits: false
Status: :running
Heap Size: 6772
Stack Size: 28
Reductions: 15517
13:12:46.399 [error] Child LXical.Server of Supervisor LXical.Server.Supervisor terminated
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in LXical.Server.Provider.Queue.add/2
(lx_server 0.5.0) lib/lexical/server/provider/queue.ex:171: LXical.Server.Provider.Queue.add(%LXical.Protocol.Requests.CodeAction{lsp: %LXical.Protocol.Requests.CodeAction.LSP{id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: #Protocol.Types.CodeAction.Context<[diagnostics: [], trigger_kind: :automatic]>, partial_result_token: nil, range: #Protocol.Types.Range<[end: #Protocol.Types.Position<[character: 7, line: 29]>, start: #Protocol.Types.Position<[character: 7, line: 29]>]>, text_document: #Protocol.Types.TextDocument.Identifier<[uri: "file:///tmp/repro01/lib/repro01_web.ex"]>, work_done_token: nil}, document: nil, range: nil, id: 11, jsonrpc: "2.0", method: "textDocument/codeAction", context: nil, partial_result_token: nil, text_document: nil, work_done_token: nil}, nil)
(lx_server 0.5.0) lib/lexical/server.ex:141: LXical.Server.handle_message/2
(lx_server 0.5.0) lib/lexical/server.ex:67: LXical.Server.handle_cast/2
(stdlib 4.3.1.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3.1.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3.1.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Pid: #PID<0.164.0>
Start Call: LXical.Server.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker
13:12:46.402 [info] Child LXical.Server of Supervisor LXical.Server.Supervisor started
Pid: #PID<0.165.0>
Start Call: LXical.Server.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker

from kakoune-lsp.

sidkshatriya avatar sidkshatriya commented on June 21, 2024

What if you changed your kak-lsp.toml command to something like <your local path to>/start_lexical.sh ? does that help ? (it didn't help for me btw, lexical still does not work with kak-lsp for me)

from kakoune-lsp.

zetashift avatar zetashift commented on June 21, 2024

What if you changed your kak-lsp.toml command to something like <your local path to>/start_lexical.sh ? does that help ? (it didn't help for me btw, lexical still does not work with kak-lsp for me)

Does not work for me either, the logs are really hard to grok for me as well :S

from kakoune-lsp.

sidkshatriya avatar sidkshatriya commented on June 21, 2024

Thanks for the fix -- I can confirm that lexical works nicely with kak-lsp now for me :-) !

from kakoune-lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.