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

Issue with self. #183

Open
DakJaniels opened this issue Nov 26, 2024 · 1 comment
Open

Issue with self. #183

DakJaniels opened this issue Nov 26, 2024 · 1 comment

Comments

@DakJaniels
Copy link

I've noticed that 'self' is sometimes not parsed correctly. Here is a section of code where 'self' is a parameter; it should trigger the colon in chatSystem.textEntry:AddCommandHistory(text), correct?

do
    local parts = {};
    local chatSystem = CHAT_SYSTEM;
    local originalAddCommandHistory = chatSystem.textEntry.AddCommandHistory;
    function chatSystem.textEntry:AddCommandHistory(text)
        -- Don't add the switch when chat is restored
        if db.addChannelAndTargetToHistory and pChatData.isAddonInitialized then
            local currentChannel = chatSystem.currentChannel;
            local currentTarget = chatSystem.currentTarget;
            local switch = chatSystem.switchLookup[currentChannel];
            if switch ~= nil then
                parts[1] = switch;
                if currentTarget then
                    parts[2] = currentTarget;
                    parts[3] = text;
                else
                    parts[2] = text;
                    parts[3] = nil;
                end;
                text = table.concat(parts, ' ');
            end;
        end;

        originalAddCommandHistory(self, text);
    end;
end;
@CppCXY
Copy link
Member

CppCXY commented Nov 27, 2024

I'm not quite sure what the issue is, but it's likely related to my previous restrictions. I'm currently rewriting the language server, so let's discuss any issues after I finish.

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

No branches or pull requests

2 participants