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

Improve/fix indent size detection for multiline doc-comments #9822

Closed
beeb opened this issue Mar 6, 2024 · 2 comments
Closed

Improve/fix indent size detection for multiline doc-comments #9822

beeb opened this issue Mar 6, 2024 · 2 comments
Labels
C-bug Category: This is a bug

Comments

@beeb
Copy link
Contributor

beeb commented Mar 6, 2024

Summary

Solidity (and likely other languages) allows for two types of documentation comment styles:

/// @notice This is the default one-line comment style

/**
 * @notice And this is the multi-line doc-comment style
 */

While the first style gives the expected indent guides and doesn't affect indent-size detection, the second is somewhat problematic for some files.

Reproduction Steps

Consider the following file:

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;

/**
 * @title MyInterface
 * @notice Defines some events
 */
interface MyInterface {
    /**
     * @notice My comment
     */
    event SomeEvent();
}

When opened in helix, it interprets the indent size as being 1 space.

image

Helix log

N/A

Platform

Linux (Ubuntu)

Terminal Emulator

wezterm 20240203-110809-5046fc22

Installation Method

nixpkgs

Helix Version

helix 23.10 (f6021dd)

@beeb beeb added the C-bug Category: This is a bug label Mar 6, 2024
@pascalkuthe
Copy link
Member

Thus would probably be solved by #9556 for a small example like this. Large files basically are never made of of more comments than actual source lines.

There is no way to detect comments in the indent heuristic so I don't think we can do more than that closing as duplicate of #9556

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
@beeb
Copy link
Contributor Author

beeb commented Mar 6, 2024

Hopefully this will fix it, but note that I'm seeing the same problem on very large files, so long as they start like the example above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants