Skip to content

function need attr table if is nil add empty table #105

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions docs/extras/lang/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import TabItem from '@theme/TabItem';

Add java to treesitter.


<Tabs>

<TabItem value="opts" label="Options">
Expand All @@ -47,7 +46,6 @@ opts = { ensure_installed = { "java" } }

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand All @@ -73,7 +71,6 @@ opts = { ensure_installed = { "java-debug-adapter", "java-test" } }

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand All @@ -92,7 +89,6 @@ opts = { ensure_installed = { "java-debug-adapter", "java-test" } }
Configure nvim-lspconfig to install the server automatically via mason, but
defer actually starting it to our configuration of nvim-jtdls below.


<Tabs>

<TabItem value="opts" label="Options">
Expand All @@ -113,7 +109,6 @@ opts = {

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand Down Expand Up @@ -141,7 +136,6 @@ opts = {

Set up nvim-jdtls to attach to java files.


<Tabs>

<TabItem value="opts" label="Options">
Expand Down Expand Up @@ -209,7 +203,6 @@ end

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand Down Expand Up @@ -305,7 +298,8 @@ end
local fname = vim.api.nvim_buf_get_name(0)

-- Configuration can be augmented and overridden by opts.jdtls
local config = extend_or_override({
local config = vim.tbl_deep_extend("force", {

cmd = opts.full_cmd(opts),
root_dir = opts.root_dir(fname),
init_options = {
Expand All @@ -314,7 +308,7 @@ end
settings = opts.settings,
-- enable CMP capabilities
capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil,
}, opts.jdtls)
}, opts.jdtls or {})

-- Existing server will be reused if the root_dir matches.
require("jdtls").start_or_attach(config)
Expand Down Expand Up @@ -439,7 +433,6 @@ opts = nil

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand All @@ -454,7 +447,6 @@ opts = nil

Ensure java debugger and test packages are installed.


<Tabs>

<TabItem value="opts" label="Options">
Expand All @@ -465,7 +457,6 @@ opts = nil

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
Expand Down