Windows/기타 프로그램(etc)

VScode 자동 완성 기능 안 켜질 때

공시탈출넘버원 2024. 7. 9. 11:07

Solution of, VSCode word auto recommend (intellisense) does not work

 

Found Solution in Answer #1 

https://stackoverflow.com/questions/29975152/intellisense-not-automatically-working-vscode#

 

Intellisense not automatically working VSCode

I just downloaded Visual Studio Code and my Intellisense is not automatically working. The two settings that control this seem to be set correctly: "editor.quickSuggestions": true, "editor.

stackoverflow.com

 

Actual Solution: delete cache files in cache folders for vscode

https://stackoverflow.com/questions/51883754/visual-studio-code-gives-me-include-error-detected-for-c/65370067#65370067

 

Visual Studio Code gives me "#include error detected" for C

I have started to learn c, I tried to use it with VSCode, but the #include <stdio.h> is highlighted in green with this error message: #include errors detected. Please update your includePath.

stackoverflow.com

 

for Koreans

 

VScode에서 문자열을 입력하면 기존에 있던 단어과 비교하여 자동완성이 편리하도록 단어를  추천해주는 기능이 있다.

이 기능을 끄는 방법은 많이 나오는데, 켜고 싶은데도 안 켜질 때 켜는 방법은 제대로 안 나온다.

수 차례 실패하고 여기저기 떠돌다가 찾은 방법이다.

두번째 링크처럼 들어가서 아래 폴더에 있는 데이터를 몽땅 지우고, VSCode를 재시작하면 해결된다.

Windows: C:\Users\User_Name\AppData\Roaming\Code\CachedData\

C드라이브 >>> 사용자 >>> 사용자 이름 >>> 이하 동일

 

 

폴더에 있는 모든 폴더와 파일을 지우고 나면, 단어완성 자동추천 기능이 동작한다.

 

 

간단한 파이썬 코드를 돌려도 좋다. 폴더가 비어있어도 잘 작동한다.

import os, shutil

path = r'C:\Users\User_Name\AppData\Roaming\Code\CachedData\' # must change, User_Name

dir_to_delete = [os.path.join(path,element) for element in os.listdir(path)]

for data_path in dir_to_delete:

    try: 
        shutil.rmtree(data_path)
        print("Directory removed successfully")
    except OSError as o:
        print(f"Error, {o.strerror}: {data_path}")
    # REF https://www.scaler.com/topics/delete-directory-python/

    # NOTE 
    # does not raise error evenif CachedData is empty
    # CANNOT os.remove(can_remove_only_file) NOR os.rmdir(can_remove_only_empty_folder)