# Import file from other directory doesn't work for lsp mode

**URL:** <https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482>\
**Category:** Feedback\
**Created:** [February 5, 2023, 6:35pm UTC](https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482 "2023-02-05T18:35:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aj3423](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/aj3423/32/864_2.png) [@aj3423](https://forum.soliditylang.org/u/aj3423)\
**Post date:** [February 5, 2023, 6:35pm UTC](https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482/1 "2023-02-05T18:35:22Z")

</div>

The following “test.sol” imports some file from other directory:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity > 0.8.0;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

```

The `@openzeppelin` files exists under `/usr/local/lib/node_modules/`, it runs fine when compiled with command line:

```auto
solc --base-path . --include-path /usr/local/lib/node_modules/ test.sol

```

But when I try to use it as lsp server by adding parameter `--lsp`:

```auto
solc --lsp --base-path . --include-path /usr/local/lib/node_modules/

```

It shows error in vim:

> Source “@openzeppelin/contracts/token/ERC20/ERC20.sol” not found: File not found. Searched the following locations: “/e/sol/1”, “/e/sol/1/node\_modules”

Seems the `--include-path` doesn’t work in lsp mode, why is that?

---

<div class="post-metadata">

**Author:** ![aj3423](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/aj3423/32/864_2.png) [@aj3423](https://forum.soliditylang.org/u/aj3423)\
**Post date:** [February 7, 2023, 12:15pm UTC](https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482/2 "2023-02-07T12:15:21Z")

</div>

I see in the [CommandLineParser.cpp](https://github.com/ethereum/solidity/blob/88e44ed5e29bcee0b22a6760bec42a1e0099875c/solc/CommandLineParser.cpp#L983)

```cpp
	// ...
	if (m_options.input.mode == InputMode::LanguageServer)
		return;
	// ...
	if (m_args.count(g_strBasePath))
		// ...

	if (m_args.count(g_strIncludePath) > 0)
	{
		// ...
	}

```

It returns before processing `--include-path` if it’s lsp mode, so the `--include-path` doesn’t work for lsp mode.  
Is there any way to import additional directory for lsp mode?

---

<div class="post-metadata">

**Author:** ![r0qs](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/r0qs/32/709_2.png) [@r0qs](https://forum.soliditylang.org/u/r0qs)\
**Post date:** [February 7, 2023, 10:41pm UTC](https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482/3 "2023-02-07T22:41:41Z")

</div>

Hi @aj3423 thanks for bring this up. In fact the LSP mode still very experimental and most of its functionality is not yet implemented, thus the error you reported. We still need to discuss if we will or not continue with the effort to develop it further as a builtin Solidity language server.

---

<div class="post-metadata">

**Author:** ![aj3423](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/aj3423/32/864_2.png) [@aj3423](https://forum.soliditylang.org/u/aj3423)\
**Post date:** [February 8, 2023, 5:03am UTC](https://forum.soliditylang.org/t/import-file-from-other-directory-doesnt-work-for-lsp-mode/1482/4 "2023-02-08T05:03:13Z")

</div>

@r0qs I see, thanks for the reply.
