Skip to content
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

FIX incomplete or undefined document symbol #2

Closed
ttax00 opened this issue Oct 30, 2022 · 0 comments · Fixed by #11
Closed

FIX incomplete or undefined document symbol #2

ttax00 opened this issue Oct 30, 2022 · 0 comments · Fixed by #11

Comments

@ttax00
Copy link
Owner

ttax00 commented Oct 30, 2022

When executing document symbol command with virtual document:

         
      <header class="fixed z-10 w-screen bg-gray-500 dark:bg-gray-800">
	<nav class="mx-auto px-2 sm:px-6 lg:px-8 grid grid-cols-2 md:grid-cols-3 gap-2">
		<div class="relative flex items-center justify-start h-16 col-span-1 md:col-span-2">
			<a href="#introduction" class="text-black dark:text-white">             </a>
			<div class="form-check form-switch ml-4">
				
			</div>
			<img src="./asset/moon-svgrepo-com.svg" alt="Night mode"
			class="h-8 w-8 filter dark:invert ml-4" />
		</div>
		<ul class="relative hidden sm:flex items-center justify-end h-16 text-black dark:text-white">
			<li class="mr-3">              </li>
			<li>
				<a href="https://www.rust-lang.org/">
					<img src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Rust_programming_language_black_logo.svg"
					class="h-10 w-10 mr-3 filter dark:invert" alt="Rust" />
				</a>
			</li>
			<li>
				<a href="https://yew.rs/" >
					<img src="https://yew.rs/img/logo.png"
					class="h-10 w-10 mr-3" alt="Yew" />
				</a>
			</li>
			<li>
				<a href="https://tailwindcss.com/">
					<img src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Tailwind_CSS_Logo.svg"
					class="h-10 w-10" alt="Tailwind CSS" />
				</a>
			</li>
		</ul>
	</nav>
</header>
	
	 

There was only 3 symbols detected and returned.
image

Expecting:
image
Which should be the same as making a new .html file with the content.

On first initialize, the symbols returned would be undefined instead of Symbol[].

Concerned snippet of code:

async provideDocumentSymbols(document, token, next) {
console.log("doing symbol!");
let result = undefined;
// FIXME: [1] result is undefined for a long time, perhaps HTML Language Service isn't started yet?
// FIXME: [2] HTML document symbol provided are greatly missing!
result = await commands.executeCommand<DocumentSymbol[]>(
	'vscode.executeDocumentSymbolProvider',
	vdocUri(document),
);

console.debug(result);
return result;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant