Exemplo n.º 1
0
        // Gets the language associated with this document context.
        int IDebugDocumentContext2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
        {
            // CLRDBG TODO: Add 'language' to the MI

            string fileExtension = _textPosition.GetFileExtension();

            if (fileExtension.Equals(".cs", StringComparison.OrdinalIgnoreCase))
            {
                pbstrLanguage = "C#";
                pguidLanguage = AD7Guids.guidLanguageCs;
            }
            // NOTE: Use a case sensitive comparison, since '.C' can be used for C++ on unix
            else if (fileExtension == ".c")
            {
                pbstrLanguage = "C";
                pguidLanguage = AD7Guids.guidLanguageC;
            }
            else
            {
                pbstrLanguage = "C++";
                pguidLanguage = AD7Guids.guidLanguageCpp;
            }

            return(Constants.S_OK);
        }
Exemplo n.º 2
0
        // Gets the language associated with this document context.
        int IDebugDocumentContext2.GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
        {
            string fileExtension = _textPosition.GetFileExtension();

            // NOTE: Use a case sensitive comparison, since '.C' can be used for C++ on unix
            if (fileExtension == ".c")
            {
                pbstrLanguage = "C";
                pguidLanguage = AD7Guids.guidLanguageC;
            }
            else
            {
                pbstrLanguage = "C++";
                pguidLanguage = AD7Guids.guidLanguageCpp;
            }

            return(Constants.S_OK);
        }