[llvm-bugs] [Bug 41787] New: clang-cl and lld-link: Come up with a way to make typo correction work for '/' style flags

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 7 06:52:53 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41787

            Bug ID: 41787
           Summary: clang-cl and lld-link: Come up with a way to make typo
                    correction work for '/' style flags
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

clang-cl and lld-link accept /foo flags in addition to -foo flags.

Since /foo is also a valid path name on non-win, the logic goes like so:

1. If /foo is a known flag, treat it as flag (use -- to treat it as file name)
2. If it isn't, treat it as a file name

So if a /foo flag has a typo, we treat it as a filename, hence don't show typo
suggestions for it, and then show a "file not found" diagnostic.


We should find a way to make typo suggestions work for /foo style flags.


Ideas:

- Have typo suggestions for filenames as well, and have a unified candidate
list for both (idea from ruiu on issue 37006)

- Add "3. If file of this name doesn't exist, consider it as a possible typo of
a flag"


The former is a nicer user experience since it also gives us spelling
suggestions for typos in file names, but it requires getting a list of files
off disk (only in error cases though) and is more work to implement.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190507/580867d0/attachment.html>


More information about the llvm-bugs mailing list